Add docker build cache to gitlab CI
This commit is contained in:
@@ -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
|
||||||
|
Reference in New Issue
Block a user