Update to Kaniko

This commit is contained in:
Comprofix 2023-12-31 16:00:15 +10:00
parent c35d041589
commit ba433e018a

View File

@ -23,18 +23,20 @@ eleventy:
- master
docker_build:
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
services:
- docker:dind
#before_script:
# - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
#services:
# - docker:dind
stage: docker_build
image: docker:latest
image: gcr.io/kaniko-project/executor:latest
script:
- docker build --no-cache --pull -t $IMAGE_TAG .
- docker push $IMAGE_TAG
- docker tag $IMAGE_TAG $IMAGE_TAG_LATEST
- docker push $IMAGE_TAG_LATEST
- docker rmi $IMAGE_TAG $IMAGE_TAG_LATEST
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$IMAGE_TAG
#- docker build --no-cache --pull -t $IMAGE_TAG .
#- docker push $IMAGE_TAG
#- docker tag $IMAGE_TAG $IMAGE_TAG_LATEST
#- docker push $IMAGE_TAG_LATEST
#- docker rmi $IMAGE_TAG $IMAGE_TAG_LATEST
only:
- master