Files
scylladb/tools/toolchain/dbuild
2019-01-03 16:16:47 +02:00

36 lines
691 B
Bash
Executable File

#!/bin/bash
group_args=()
docker_args=()
for gid in $(id -G); do
group_args+=(--group-add "$gid")
done
if [[ "$1" = -* ]]; then
while [[ "$1" != "--" && $# != 0 ]]; do
docker_args+=("$1")
shift
done
if [[ "$1" != "--" ]]; then
echo "Expected '--' to terminate docker flag list"
exit 1
fi
shift
fi
docker run \
--sig-proxy=true \
--rm \
-u "$(id -u):$(id -g)" \
"${group_args[@]}" \
--cap-add SYS_PTRACE \
-v "$PWD:$PWD" \
-v /tmp:/tmp \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/group:/etc/group:ro \
-w "$PWD" \
"${docker_args[@]}" \
"$(<tools/toolchain/image)" \
"$@"