Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Docker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SmartDataLab
public
CI-CD components
Docker
Commits
63016e61
Commit
63016e61
authored
1 year ago
by
Kiran Patel
Browse files
Options
Downloads
Patches
Plain Diff
fix: derive buildah cache from snapshot image
parent
789c25db
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/gitlab-ci-docker.yml
+4
-3
4 additions, 3 deletions
templates/gitlab-ci-docker.yml
with
4 additions
and
3 deletions
templates/gitlab-ci-docker.yml
+
4
−
3
View file @
63016e61
...
...
@@ -586,12 +586,13 @@ docker-buildah-build:
extends
:
.docker-base
stage
:
package-build
image
:
"
$DOCKER_BUILDAH_IMAGE"
variables
:
BUILDAH_BUILD_CACHE
:
"
$CI_REGISTRY_IMAGE/snapshot/cache"
script
:
-
configure_containers_registries
# derive buildah_build_cache repository
-
buildah_build_cache="${DOCKER_SNAPSHOT_IMAGE%:*}/cache"
-
log_info "Using ${buildah_build_cache} as build cache repository"
# build and push image
-
buildah build --file "$DOCKER_FILE" --tag $DOCKER_SNAPSHOT_IMAGE --layers --cache-from $
BUILDAH_BUILD_CACHE --cache-to $BUILDAH_BUILD_CACHE
--build-arg http_proxy="$http_proxy" --build-arg https_proxy="$https_proxy" --build-arg no_proxy="$no_proxy" $DOCKER_METADATA $DOCKER_BUILD_ARGS "$(docker_context_path)"
-
buildah build --file "$DOCKER_FILE" --tag $DOCKER_SNAPSHOT_IMAGE --layers --cache-from $
buildah_build_cache --cache-to $buildah_build_cache
--build-arg http_proxy="$http_proxy" --build-arg https_proxy="$https_proxy" --build-arg no_proxy="$no_proxy" $DOCKER_METADATA $DOCKER_BUILD_ARGS "$(docker_context_path)"
-
buildah push --digestfile .img-digest.txt "$DOCKER_SNAPSHOT_IMAGE"
# display digest of the resulting image
-
cat .img-digest.txt
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment