Skip to content

Commit

Permalink
scripts: user-specified container build params
Browse files Browse the repository at this point in the history
This allows a developer who invokes scripts/container.image.build.bash to
specify arbitrary parameters for the underlying builder.

e.g. "--no-cache", which is a better way of avoiding using the local build
cache than bumping the CI-focussed build ARG at the top of
container/build/Containerfile.
  • Loading branch information
jpluscplusm committed Jan 9, 2025
1 parent f39e792 commit ae3a373
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/container.image.build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ set -euo pipefail

# container.image.build.bash builds an image from a stage defined in
# container/build/Containerfile, and tags it as "ynr:$image".
image="$1"
image="$1"; shift
args="$@"

# Change to the directory above the directory containing this script.
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/.."
Expand All @@ -17,4 +18,4 @@ else
fi; set -u

# Build the image.
"$builder" build --target "$image" --tag "ynr:$image" -f container/build/Containerfile .
"$builder" build --target "$image" --tag "ynr:$image" -f container/build/Containerfile $args .

0 comments on commit ae3a373

Please sign in to comment.