message: switch to kaniko to build images
diff: @@ -4,25 +4,24 @@ stages:
  - test
  variables:
  - DOCKER_FILE: Dockerfile
  - DOCKER_TAG: latest
  + DOCKER_TAG: ${CI_COMMIT_BRANCH}
  DOCKER_IMAGE: ${CI_REGISTRY_IMAGE}
  - IMAGE: ${CI_REGISTRY_IMAGE}
  GIT_SUBMODULE_STRATEGY: normal
  FF_GITLAB_REGISTRY_HELPER_IMAGE: 1
  .prepare:docker: &prepare_docker
  stage: prepare
  image:
  - name: docker
  - before_script:
  - - docker version
  - - docker login --username "${CI_REGISTRY_USER}" --password "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
  + name: gcr.io/kaniko-project/executor:debug
  + entrypoint: [ "" ]
  script:
  - - docker build -f ${DOCKER_FILE} -t ${DOCKER_IMAGE}:${DOCKER_TAG} .
  - - docker push ${DOCKER_IMAGE}:${DOCKER_TAG}
  - tags:
  - - docker
  + - mkdir -p /kaniko/.docker
  + - 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 ${DOCKER_IMAGE}:${DOCKER_TAG}
  + --snapshotMode=redo
  prepare:docker:
  <<: *prepare_docker
  