diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eb6a9fe01a95e62a06bdc83cf16c3519c5b677c8..b07558debf15a326af8885f0ed0dd53114b0dcd1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,15 +12,12 @@ docker-build: # Use the official docker image. - image: docker:latest + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] stage: build - services: - - docker:dind - before_script: - - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY - # Default branch leaves tag empty (= latest tag) - # All other branches are tagged with the escaped branch name (commit ref slug) script: + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - | if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then tag="" @@ -29,9 +26,7 @@ docker-build: tag=":$CI_COMMIT_REF_SLUG" echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag" fi - - cd $CI_PROJECT_DIR/deploy/build_env/manylinux2010 - - docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" . - - docker push "$CI_REGISTRY_IMAGE${tag}" + - /kaniko/executor --cache=false --context $CI_PROJECT_DIR/deploy/build_env/manylinux2010 --dockerfile $CI_PROJECT_DIR/deploy/build_env/manylinux2010/Dockerfile --destination $CI_REGISTRY_IMAGE${tag} # Run this job in a branch where a Dockerfile exists rules: - if: $CI_COMMIT_BRANCH