Skip to content

Commit

Permalink
Add command line options to build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
killenheladagen committed Mar 15, 2024
1 parent 5f7d2af commit d196fdf
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,33 @@ armv7hf | aarch64) ;;
exit 1
;;
esac
arch="$1"
shift

progress_arg=
cache_arg=--no-cache

while (($#)); do
case "$1" in
--plain) progress_arg="--progress plain";;
--cache) cache_arg=;;
*)
echo "Invalid argument '$1'"
exit 1
;;
esac
shift
done

imagetag="${2:-docker-acap:1.0}"

# Build and copy out the acap
docker buildx build --build-arg ACAPARCH="$1" \
docker buildx build --build-arg ACAPARCH="$arch" \
--build-arg HTTP_PROXY="${HTTP_PROXY:-}" \
--build-arg HTTPS_PROXY="${HTTPS_PROXY:-}" \
--file Dockerfile \
--no-cache \
$progress_arg \
$cache_arg \
--tag "$imagetag" .

docker cp "$(docker create "$imagetag")":/opt/app/ ./build-"$1"
docker cp "$(docker create "$imagetag")":/opt/app/ ./build-"$arch"

0 comments on commit d196fdf

Please sign in to comment.