From dba46b940a981b5f829f1d1cddea63f30869a50a Mon Sep 17 00:00:00 2001
From: lb584 <lb584@cam.ac.uk>
Date: Wed, 28 Jun 2023 15:49:08 +0100
Subject: [PATCH] more Docker file work

---
 configs/docker/build/build.sh               | 6 ++++++
 tests/integration/partial/run_test_suite.sh | 9 +++++----
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/configs/docker/build/build.sh b/configs/docker/build/build.sh
index e59bc1a..829f1ef 100644
--- a/configs/docker/build/build.sh
+++ b/configs/docker/build/build.sh
@@ -1,3 +1,9 @@
 cp ../../conda/conda-env-py3EWS-withbuilds.yml .;
+#   note that if you want to build an image that runs with your credentials, override the following variables when
+#   building the image:
+#   sudo docker build -t ews_coordinator --build-arg GNAME=lb584 --build-arg UNAME=lb584
+#   --build-arg UID=1001 --build-arg GID=1001 -f Dockerfile .
+#   the docker container will run commands using this user and group, and will have access to the relevant filesystems
+#   that are mounted. If the default command is run, the user credentials are set to be those of the Cam group server
 sudo docker build -t ews_coordinator -f Dockerfile .;
 rm -v conda-env-py3EWS-withbuilds.yml;
diff --git a/tests/integration/partial/run_test_suite.sh b/tests/integration/partial/run_test_suite.sh
index a87c486..539900e 100755
--- a/tests/integration/partial/run_test_suite.sh
+++ b/tests/integration/partial/run_test_suite.sh
@@ -1,6 +1,7 @@
 
-#note this script only works if run in the project docker image, or an environment with the necessary paths and
-# software installed
+# note this script only works if run in the project docker image, or an environment with the necessary paths and
+# software installed. it writes files to a unix tmp dir and is not intended to be used for diagnostic testing, just
+# checking the installation is working
 
 source /storage/app/miniconda3/bin/activate /storage/app/EWS_prod/envs/conda/py3EWS/
 
@@ -22,5 +23,5 @@ export PYTHONPATH=$PYTHONPATH:$flagdir:$epimodel:$advisory:$met_processing:$met_
 
 echo $PYTHONPATH
 
-tempdir=`mktemp -d`
-python3 -m coverage run run_test_suite.py $tempdir
+tempdir=$(mktemp -d)
+python3 -m coverage run run_test_suite.py "$tempdir"
-- 
GitLab