Add support for no-cache option in Docker build scripts. Update build-docker.ps1 and build-docker.sh to include --no-cache flag when PISCAL_BUILD_NO_CACHE environment variable is set, improving build flexibility.
This commit is contained in:
@@ -26,6 +26,9 @@ $BuildArgs = @("-t", "piscal:$Version", "-t", "piscal:latest", "-t", "piscal:dev
|
||||
if ($env:PISCAL_SSH_PASSWORD) {
|
||||
$BuildArgs += "--build-arg", "SSH_PASSWORD=$($env:PISCAL_SSH_PASSWORD)"
|
||||
}
|
||||
if ($env:PISCAL_BUILD_NO_CACHE) {
|
||||
$BuildArgs += "--no-cache"
|
||||
}
|
||||
docker build @BuildArgs .
|
||||
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
|
||||
@@ -24,6 +24,7 @@ BUILD_ARGS=(-t "piscal:${VERSION}" -t piscal:latest -t piscal:dev)
|
||||
if [ -n "${PISCAL_SSH_PASSWORD:-}" ]; then
|
||||
BUILD_ARGS+=(--build-arg "SSH_PASSWORD=${PISCAL_SSH_PASSWORD}")
|
||||
fi
|
||||
[ -n "${PISCAL_BUILD_NO_CACHE:-}" ] && BUILD_ARGS+=(--no-cache)
|
||||
|
||||
docker build "${BUILD_ARGS[@]}" .
|
||||
|
||||
|
||||
Reference in New Issue
Block a user