From 05164636a17a9312596dfd70244ba5c4c93c486f Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Tue, 1 Sep 2020 17:59:56 +0200 Subject: [PATCH] Switch to kaniko to build docker image --- .gitlab-ci.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 921c1422..c3931b8f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,10 +5,13 @@ stages: docker: stage: build_docker_image + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] script: - - docker login -u $CI_REGISTRY_USERNAME -p $CI_BUILD_TOKEN - - docker build -t $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME . - - docker push $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME + - mkdir -p /kaniko/.docker + - echo "{\"auths\":{\"registry.hub.docker.com\":{\"username\":\"$CI_REGISTRY_USERNAME\",\"password\":\"$CI_BUILD_TOKEN\"}}}" > /kaniko/.docker/config.json + - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME only: - master - beta