Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop pulling/pushing if not logged in #150

Merged
merged 2 commits into from
Oct 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,13 @@ _build_image_buildkit() {
local cache_image
cache_image="$(_get_full_stages_image_name)":cache

local cache_from
if _can_pull; then
cache_from="--cache-from type=registry,ref=$cache_image"
fi

local cache_to
if _must_push; then
if _can_push; then
cache_to="--cache-to mode=max,image-manifest=true,type=registry,ref=$cache_image"
fi

Expand All @@ -410,7 +415,7 @@ _build_image_buildkit() {
# shellcheck disable=SC2086
docker buildx build \
--load \
--cache-from type=registry,ref="$cache_image" \
$cache_from \
$cache_to \
--tag "$DUMMY_IMAGE_NAME" \
--file "${INPUT_CONTEXT}"/"${INPUT_DOCKERFILE}" \
Expand Down
Loading