18 lines
593 B
Bash
Executable File
18 lines
593 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
# Apple container CLI on macOS, Docker CE on Linux.
|
|
case "$(uname -s)" in
|
|
Darwin) CONTAINER_RUNTIME=container ;;
|
|
Linux) CONTAINER_RUNTIME=docker ;;
|
|
*) printf 'ERROR: unsupported platform %s\n' "$(uname -s)" >&2; exit 1 ;;
|
|
esac
|
|
|
|
mkdir -p out
|
|
|
|
$CONTAINER_RUNTIME build --build-arg HOST_UID=$(id -u) --build-arg HOST_GID=$(id -g) -t vpn-router-builder "$@" .
|
|
# Artifacts are streamed out as a tar archive, so no bind mount is needed.
|
|
$CONTAINER_RUNTIME run --rm vpn-router-builder tar -cf - -C /out . | tar -xf - -C out
|
|
|
|
echo "Build artifacts written to out/"
|