Skip to content
Snippets Groups Projects
Verified Commit 5d7e966c authored by Mark's avatar Mark
Browse files

Use a more generic version to pass args

parent faff9368
No related branches found
No related tags found
No related merge requests found
......@@ -9,12 +9,9 @@
# - KANIKO_CONTEXT: The subdir which holds the Dockerfile, leave unset if
# the Dockerfile is located at root level of the project.
#
# - KANIKO_EXTEND_BASEIMAGE: Name of an image that is build in the same
# pipeline and is being used by your dockerfile as a baseimage.
# You need to specify the argument `baseimage` in your dockerfile and use
# this argument in the `FROM` instruction.
# see [how to use build arguments](https://docs.docker.com/engine/reference/builder/#arg)
# for more information.
# - KANIKO_ADDITIONAL_ARGS: This variable allows you to pass in ARG values that
# are used at build time. Similarly to Docker you can specify multiple arguments
# using the format `--build-arg NAME=VALUE` as many times as you need.
.kaniko_build:
stage: build
image:
......@@ -25,5 +22,4 @@
script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- if [ -n "${KANIKO_BUILD_IMAGENAME}" ]; then export IMAGENAME="/${KANIKO_BUILD_IMAGENAME}"; fi
- if [ -n "${KANIKO_EXTEND_BASEIMAGE}" ]; then export BASEIMAGE="--build-arg baseimage=${CI_REGISTRY_IMAGE}/${KANIKO_EXTEND_BASEIMAGE}:${CI_COMMIT_REF_NAME}"; fi
- /kaniko/executor --context ${CI_PROJECT_DIR}/${KANIKO_CONTEXT:-.} --dockerfile ${CI_PROJECT_DIR}/${KANIKO_CONTEXT:-.}/Dockerfile --destination ${CI_REGISTRY_IMAGE}${IMAGENAME}:${CI_COMMIT_REF_NAME} ${BASEIMAGE}
- /kaniko/executor --context ${CI_PROJECT_DIR}/${KANIKO_CONTEXT:-.} --dockerfile ${CI_PROJECT_DIR}/${KANIKO_CONTEXT:-.}/Dockerfile --destination ${CI_REGISTRY_IMAGE}${IMAGENAME}:${CI_COMMIT_REF_NAME} ${KANIKO_ADDITIONAL_ARGS}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment