mirror of https://gitlab.crans.org/bde/nk20
Switch to kaniko to build docker image
This commit is contained in:
parent
361ea8cad3
commit
05164636a1
|
@ -5,10 +5,13 @@ stages:
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
stage: build_docker_image
|
stage: build_docker_image
|
||||||
|
image:
|
||||||
|
name: gcr.io/kaniko-project/executor:debug
|
||||||
|
entrypoint: [""]
|
||||||
script:
|
script:
|
||||||
- docker login -u $CI_REGISTRY_USERNAME -p $CI_BUILD_TOKEN
|
- mkdir -p /kaniko/.docker
|
||||||
- docker build -t $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME .
|
- echo "{\"auths\":{\"registry.hub.docker.com\":{\"username\":\"$CI_REGISTRY_USERNAME\",\"password\":\"$CI_BUILD_TOKEN\"}}}" > /kaniko/.docker/config.json
|
||||||
- docker push $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
|
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
- beta
|
- beta
|
||||||
|
|
Loading…
Reference in New Issue