Add docker build cache to gitlab CI

This commit is contained in:
2025-07-25 14:06:10 +03:30
parent ccb810ee69
commit e7b8338932

View File

@@ -22,7 +22,7 @@ docker-build:
# All branches are tagged with $DOCKER_IMAGE_NAME (defaults to commit ref slug) # All branches are tagged with $DOCKER_IMAGE_NAME (defaults to commit ref slug)
# Default branch is also tagged with `latest` # Default branch is also tagged with `latest`
script: script:
- docker build --pull -t "$DOCKER_IMAGE_NAME" . - docker build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from $CI_REGISTRY_IMAGE:latest --pull -t "$DOCKER_IMAGE_NAME" .
- docker push "$DOCKER_IMAGE_NAME" - docker push "$DOCKER_IMAGE_NAME"
- | - |
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then