Skip to content
Snippets Groups Projects
Commit 84973718 authored by Natalia Miakushina's avatar Natalia Miakushina
Browse files

added cache for kaniko

parent 69154f65
No related branches found
No related tags found
No related merge requests found
Pipeline #86507 passed
variables:
KANIKO_CACHE_TTL: "2190h0m0s" # three months
stages:
- Docker build
......@@ -16,8 +18,13 @@ docker:
fi
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
# cache warmup for further build/push commands
- |
/kaniko/warmer \
--image=${CI_REGISTRY_IMAGE}:latest --cache-dir=/cache
- |
/kaniko/executor \
--cache --cache-dir=/cache --cache-ttl="${KANIKO_CACHE_TTL}" --cache-copy-layers --cache-repo="${CI_REGISTRY_IMAGE}" \
--context "${CI_PROJECT_DIR}" \
--dockerfile "${CI_PROJECT_DIR}/Dockerfile" \
--destination "${CI_REGISTRY_IMAGE}:${CONTAINER_TAG}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment