]> git.localhorst.tv Git - blank.git/commitdiff
move env inside docker container
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 22 Nov 2016 13:33:07 +0000 (14:33 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Tue, 22 Nov 2016 13:33:07 +0000 (14:33 +0100)
scripts/docker/exec.bash

index 9874c9a9f49fbe0b4db2d0d06e790f557eeb89b6..e55ce57de700c988020c7985f9bee9d01c85b771 100755 (executable)
@@ -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}"