Skip to content

Commit

Permalink
Build from 'builder.dockerfile' if that exists (#46)
Browse files Browse the repository at this point in the history
This change is needed to allow keeping the builder updated via
dependabot.
  • Loading branch information
fwilhe authored Dec 19, 2023
1 parent d335eb9 commit a3d2bed
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,14 @@ done

if [ "$container_image" = localhost/builder ]; then
dir="$(dirname -- "$(realpath -- "${BASH_SOURCE[0]}")")"
containerfile=$([[ -f builder.dockerfile ]] && echo -f builder.dockerfile || true )
"$container_engine" build -t "$container_image" $containerfile "$dir"
# Build from 'builder.dockerfile' if that exists, otherwise the default file name will be 'Dockerfile' or 'Containerfile'.
# It is recommended to call the file 'builder.dockerfile' to make it's intention clear.
# That file might only contain a single line 'FROM ghcr.io/gardenlinux/builder:...' which can be updated via dependabot.
if [[ -f builder.dockerfile ]]; then
"$container_engine" build -t "$container_image" -f builder.dockerfile "$dir"
else
"$container_engine" build -t "$container_image" "$dir"
fi
fi

repo="$(./get_repo)"
Expand Down

0 comments on commit a3d2bed

Please sign in to comment.