Skip to content
Snippets Groups Projects
Commit 2d5eb11a authored by Lorenzo Del Pianta's avatar Lorenzo Del Pianta :robot:
Browse files

Changing builder image in ci pipeline

parent 4835fb3e
No related branches found
No related tags found
1 merge request!273Changing builder image in ci pipeline
......@@ -7,15 +7,18 @@ stages:
.build_image: &build_image
image:
# We recommend using the CERN version of the Kaniko image: gitlab-registry.cern.ch/ci-tools/docker-image-builder
name: 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: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
# This is not the common Authentication config, unknown reason why common config fails
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"auth\":\"$(echo -n ${CI_REGISTRY_USER}:${CI_REGISTRY_PASSWORD} | base64)\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context "$CI_PROJECT_DIR/$CONTEXT_DIR" --dockerfile "$CI_PROJECT_DIR/$CONTEXT_DIR/$DOCKERFILE"
--destination "${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${TAG}" $BUILD_ARGS
- echo "Image pushed to ${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${TAG}"
# define script variables, they are passed in build time
- IMAGE_DESTINATION=${CI_REGISTRY_IMAGE}/${IMAGE_NAME}:${TAG}
# Prepare Kaniko configuration file
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
# 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:
stage: environment
......
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