From 89ba5c821140ce578f90e7918a1615f04448d9f4 Mon Sep 17 00:00:00 2001 From: Maarten de Waard Date: Wed, 29 Sep 2021 15:09:40 +0200 Subject: [PATCH] add gitlab ci file to build docker container --- .gitlab-ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..b27ecf1 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,17 @@ +stages: + - build-container + +variables: + KANIKO_BUILD_IMAGENAME: admin-backend + +build-container: + stage: build-container + image: + # We need a shell to provide the registry credentials, so we need to use the + # kaniko debug image (https://github.com/GoogleContainerTools/kaniko#debug-image) + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + script: + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json + - /kaniko/executor --cache=true --context ${CI_PROJECT_DIR}/ --dockerfile ${CI_PROJECT_DIR}/Dockerfile --destination ${CI_REGISTRY_IMAGE}/${KANIKO_BUILD_IMAGENAME}:${CI_COMMIT_REF_NAME} +