fix: build image with --no-cache (#275)

This commit is contained in:
Brandon Keiji 2025-05-07 15:18:04 +00:00 committed by GitHub
parent 49b5db29b3
commit ed0b90644a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

3
.gitignore vendored
View File

@ -19,3 +19,6 @@ Thumbs.db
# Ignore built ts files
dist
# Docker folder to help skip auth refreshes
.docker

View File

@ -67,10 +67,10 @@ echo "building $IMAGE ... (can be slow first time)"
if [[ "$CMD" == "podman" ]]; then
# use empty --authfile to skip unnecessary auth refresh overhead
$CMD build --authfile=<(echo '{}') -f "$DOCKERFILE" -t "$IMAGE" .
$CMD build --authfile=<(echo '{}') --no-cache -f "$DOCKERFILE" -t "$IMAGE" .
elif [[ "$CMD" == "docker" ]]; then
# use an empty config directory to skip unnecessary auth refresh overhead
$CMD --config="empty" buildx build -f "$DOCKERFILE" -t "$IMAGE" .
# use config directory to skip unnecessary auth refresh overhead
$CMD --config=".docker" buildx build --no-cache -f "$DOCKERFILE" -t "$IMAGE" .
else
$CMD build -f "$DOCKERFILE" -t "$IMAGE" . >/dev/null
fi