Files
scylladb/tools/toolchain/dbuild
Avi Kivity 274f553485 tools: toolchain: run dbuild container with same timezone as host
Make it easier to work interactively by not reporting surprising times.

There are also reports that dtest fails with incorrect timezones, but those
are probably bugs in dtest.
Message-Id: <20190127134754.1428-1-avi@scylladb.com>
2019-01-27 22:48:42 +00:00

40 lines
834 B
Bash
Executable File

#!/bin/bash
here="$(realpath $(dirname "$0"))"
toplevel="$(realpath "$here/../..")"
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 "$toplevel:$toplevel" \
-v /tmp:/tmp \
-v /etc/passwd:/etc/passwd:ro \
-v /etc/group:/etc/group:ro \
-v /etc/localtime:/etc/localtime:ro \
-w "$PWD" \
"${docker_args[@]}" \
"$(<"$here/image")" \
"$@"