ソースを参照

Allow the docker scripts to be run from other directories

Ian Goldberg 6 ヶ月 前
コミット
345e335e68
2 ファイル変更10 行追加0 行削除
  1. 5 0
      docker/build-docker
  2. 5 0
      docker/set-networking

+ 5 - 0
docker/build-docker

@@ -1,4 +1,9 @@
 #!/bin/bash
 
+# cd into the directory containing this script (from the bash faq 028)
+if [[ $BASH_SOURCE = */* ]]; then
+  cd -- "${BASH_SOURCE%/*}/" || exit
+fi
+
 cd ..
 docker build $* -t oram -f docker/Dockerfile .

+ 5 - 0
docker/set-networking

@@ -1,5 +1,10 @@
 #!/bin/bash
 
+# cd into the directory containing this script (from the bash faq 028)
+if [[ $BASH_SOURCE = */* ]]; then
+  cd -- "${BASH_SOURCE%/*}/" || exit
+fi
+
 latency=30ms
 bw=100mbit