Skip to content
Snippets Groups Projects

Changing builder image in ci pipeline

Merged Lorenzo Del Pianta requested to merge gitlab-ci_update into v10.3-0
+ 10
7
@@ -7,15 +7,18 @@ stages:
@@ -7,15 +7,18 @@ stages:
.build_image: &build_image
.build_image: &build_image
image:
image:
# We recommend using the CERN version of the Kaniko image: gitlab-registry.cern.ch/ci-tools/docker-image-builder
# The kaniko debug image is recommended because it has a shell, and a shell is required for an image to be used with GitLab CI/CD.
name: gitlab-registry.cern.ch/ci-tools/docker-image-builder
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
entrypoint: [""]
script:
script:
# This is not the common Authentication config, unknown reason why common config fails
# define script variables, they are passed in build time
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD} | base64)\"}}}" > /kaniko/.docker/config.json
- IMAGE_DESTINATION=${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${TAG}
- /kaniko/executor --context "$CI_PROJECT_DIR/$CONTEXT_DIR" --dockerfile "$CI_PROJECT_DIR/$CONTEXT_DIR/$DOCKERFILE"
# Prepare Kaniko configuration file
--destination "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${TAG}" $BUILD_ARGS
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- echo "Image pushed to ${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${TAG}"
# Build and push the image from the Dockerfile at the root of the project.
 
- /kaniko/executor --context "$CI_PROJECT_DIR/$CONTEXT_DIR" --dockerfile "$CI_PROJECT_DIR/$CONTEXT_DIR/$DOCKERFILE" --destination "${IMAGE_DESTINATION}" $BUILD_ARGS
 
# Print the full registry path of the pushed image
 
- echo "Image pushed to ${IMAGE_DESTINATION}"
environment:
environment:
stage: environment
stage: environment
Loading