Skip to content
Snippets Groups Projects
Commit 552eb166 authored by Robert Drab's avatar Robert Drab
Browse files

Merge branch 'toolbox-dunfell' into 'dunfell'

Add Toolbox compatible bitbake container

See merge request OSTC/pre-integration/meta-openharmony!38
parents 49cccf78 565a07c9
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,18 @@ variables:
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
variables:
CONTAINER_DOCKERFILE: Dockerfile
script:
- if [ -z "$CONTAINER_PATH" ] ; then
CONTAINER_PATH="$CONTAINER_NAME" ;
fi
- CONTEXT="$CI_PROJECT_DIR/.ostc-ci/container/$CONTAINER_PATH"
- DOCKERFILE="$CONTEXT/$CONTAINER_DOCKERFILE"
- if [ -n "$CONTAINER_FROM" ] ; then
sed -e "s|^FROM .*|FROM $CI_REGISTRY_IMAGE/$CONTAINER_FROM:$CONTAINER_VERSION|"
-i "$DOCKERFILE" ;
fi
- mkdir -p /kaniko/.docker
- printf '{"auths":{"%s":{"auth":"%s"}}}\n' "$CI_REGISTRY" "$(printf '%s:%s' "$CI_REGISTRY_USER" "$CI_REGISTRY_PASSWORD" | base64)" > /kaniko/.docker/config.json
- BUILD_DATE="$(date '+%FT%T%z' | sed -E -n 's/(\+[0-9]{2})([0-9]{2})$/\1:\2/p')" #rfc 3339 date
......@@ -50,12 +61,23 @@ variables:
--label vcs-url=$CI_PROJECT_URL"
- echo "Building and shipping image to $CI_REGISTRY_IMAGE"
- exec /kaniko/executor --cache=true
--context "$CI_PROJECT_DIR/.ostc-ci/container/$CONTAINER_PATH"
--dockerfile "$CI_PROJECT_DIR/.ostc-ci/container/$CONTAINER_PATH/Dockerfile"
--destination "$CI_REGISTRY_IMAGE/$CONTAINER_PATH:$CONTAINER_VERSION"
--context "$CONTEXT" --dockerfile "$DOCKERFILE"
--destination "$CI_REGISTRY_IMAGE/$CONTAINER_NAME:$CONTAINER_VERSION"
bitbake-builder:
extends: .kaniko
variables:
CONTAINER_PATH: bitbake-builder
CONTAINER_NAME: bitbake-builder
CONTAINER_VERSION: $BITBAKE_CONTAINER_VERSION
bitbake-toolbox:
extends: .kaniko
variables:
CONTAINER_NAME: bitbake-toolbox
CONTAINER_VERSION: $BITBAKE_CONTAINER_VERSION
CONTAINER_PATH: bitbake-builder
CONTAINER_DOCKERFILE: Dockerfile.toolbox
CONTAINER_FROM: bitbake-builder
needs:
- job: bitbake-builder
artifacts: false
# Copyright 2020 Huawei Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
FROM bitbake-builder
# Revert setup with builder user account
USER root
WORKDIR /
RUN userdel -r builder
# Install packages needed by Toolbox
ARG DEBIAN_FRONTEND="noninteractive"
RUN apt-get update -qq \
&& apt-get install -qq -y \
bash sudo libcap2-bin locales \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Use UTF-8 locale
RUN echo "locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8" | debconf-set-selections \
&& echo "locales locales/default_environment_locale select en_US.UTF-8" | debconf-set-selections \
&& sed -i 's/^# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure locales
ENV LANG=en_US.UTF-8
# Allow password-less sudo
RUN echo '%sudo ALL=(ALL:ALL) NOPASSWD:ALL' > /etc/sudoers.d/toolbox
LABEL com.github.containers.toolbox="true" \
com.github.debarshiray.toolbox="true"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment