From 2fd79ba87b03282756f4d653f121f2811d1584c7 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Tue, 22 Nov 2016 14:33:07 +0100 Subject: [PATCH] move env inside docker container --- scripts/docker/exec.bash | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/docker/exec.bash b/scripts/docker/exec.bash index 9874c9a..e55ce57 100755 --- a/scripts/docker/exec.bash +++ b/scripts/docker/exec.bash @@ -24,5 +24,15 @@ if [ -e "${image_path}/env" ]; then local_conf="$local_conf --env-file ${image_path}/env" fi +# copy DISPLAY if set +if [ "$DISPLAY" != "" ]; then + local_conf="$local_conf -e DISPLAY=$DISPLAY" +fi + +# copy XDG_RUNTIME_DIR if set +if [ "$XDG_RUNTIME_DIR" != "" ]; then + local_conf="$local_conf -e XDG_RUNTIME_DIR='$XDG_RUNTIME_DIR'" +fi + docker build -t "${image_name}" --pull=true "${image_path}" -docker run -v "$PWD":/repo ${local_conf} "${image_name}" /bin/bash -c "${build_cmd}" +docker run -v "$PWD":/repo ${local_conf} "${image_name}" /bin/bash -c "env && ${build_cmd}" -- 2.39.2