mirror of
https://github.com/falk-werner/webfuse-provider
synced 2026-03-02 04:09:18 +00:00
chore(webfuse): debian build support (#22)
* adds debian builder image * adds arm32v7 debian based builder image * sets the default build target to amd64-ubuntu-builder if MARCH is unset * adds distro filter and set default to ubuntu for travis disables debian builds for now * fixes wrapper for non container hosts * fixes distro selection and parallel mflags * changes parallelization option * fixes parallel flags and variable names * enhances makefile adds checksum for fetch dependencies discovers necessary commands fixes error when script get_container_id not found * fixes copy artifacts to image * fixes typo * fixes another typo * removes bash dependency - simplifies scripts to support posix shell - adds REGISTERY_PREFIX to support usage of local docker registry - renames wrapper template - adds discovery for tty and interactive for wrappers * adds docker-compose wrapper * adds ability to start wrapper in namespace of another container * renames compose wrapper script * adds support to retrieve source epoch date for svn * fixes handling for positional arguments * removes docker connection options * removes dependency to readlink * removes duplicate options
This commit is contained in:
52
build/run_image.sh.template
Normal file
52
build/run_image.sh.template
Normal file
@@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
DOCKER="${DOCKER:-%DOCKER%}"
|
||||
IMAGE="${IMAGE:-%IMAGE%}"
|
||||
NETWORK="${NETWORK:-host}"
|
||||
PROJECT_ROOT="${PROJECT_ROOT:-%PROJECT_ROOT%}"
|
||||
SCRIPT_ROOT="${SCRIPT_ROOT:-"$PROJECT_ROOT/build"}"
|
||||
ENTRYPOINT="${ENTRYPOINT:-%RUNCMD%}"
|
||||
|
||||
if [ ! -d "$SCRIPT_ROOT" ]; then
|
||||
echo "error:$0: $SCRIPT_ROOT not found; set project root (PROJECT_ROOT=)" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -- --entrypoint "$ENTRYPOINT" "$IMAGE" "$@"
|
||||
set -- --network "$NETWORK" --workdir "$PWD" "$@"
|
||||
|
||||
if [ -n "$USERID" ]; then
|
||||
set -- --user "$USERID:$USERID" "$@"
|
||||
fi
|
||||
|
||||
if [ -n "$PID" ]; then
|
||||
set -- --pid "$PID" "$@"
|
||||
fi
|
||||
|
||||
if [ -n "$CONTAINER_CGROUP_PARENT" ]; then
|
||||
set -- --cgroup-parent "$CONTAINER_CGROUP_PARENT" "$@"
|
||||
fi
|
||||
|
||||
HOST_CONTAINER="${HOST_CONTAINER:-"$("$SCRIPT_ROOT/get_container_id.sh")"}" || true
|
||||
if [ -n "$HOST_CONTAINER" ]; then
|
||||
set -- --volumes-from "$HOST_CONTAINER" "$@"
|
||||
fi
|
||||
|
||||
set -- %RUNFLAGS% "$@"
|
||||
|
||||
if [ -t 0 ] && ! "$SCRIPT_ROOT/is_running_in_bg.sh" $$; then
|
||||
set -- --interactive "$@"
|
||||
fi
|
||||
|
||||
# if STDIN piped or redirected
|
||||
if [ -p /dev/stdin ] || { [ ! -t 0 ] && [ ! -p /dev/stdin ]; }; then
|
||||
set -- --interactive "$@"
|
||||
elif [ -t 1 ]; then
|
||||
set -- --tty "$@"
|
||||
fi
|
||||
|
||||
set -- --rm "$@"
|
||||
|
||||
exec "$DOCKER" run "$@"
|
||||
Reference in New Issue
Block a user