diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-01-03 17:59:31 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2021-01-03 17:59:31 +0000 |
commit | 7654f42e2d36c49b388abc653c5017170eea3ce1 (patch) | |
tree | bfd4ae634249d9730432670c25df7a0bf7aa4eed /tcwg-start-container.sh | |
parent | 50781c0bdac875936dab082d1043f7f4a3317546 (diff) |
Docker image pull/use: Fix and improve
Change-Id: Ieb39c841151533d7553786f78f80fbb7a62857e2
Diffstat (limited to 'tcwg-start-container.sh')
-rwxr-xr-x | tcwg-start-container.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tcwg-start-container.sh b/tcwg-start-container.sh index 5c227871..2c0efb2c 100755 --- a/tcwg-start-container.sh +++ b/tcwg-start-container.sh @@ -53,6 +53,18 @@ docker run --rm $image start.sh > "$start_sh" bash "$start_sh" "$@" rm "$start_sh" +# See start-container-docker.sh for background on image stamp files. +# Note that there is no need to track pull requests, since these happen +# once a day anyway. +stamp_dir=/home/shared/docker +if ! [ -d "$stamp_dir" ]; then + sudo mkdir -p "$stamp_dir" || mkdir -p "$stamp_dir" + sudo chmod 0777 "$stamp_dir" || chmod 0777 "$stamp_dir" +fi +image_stamp="$stamp_dir/$(echo "$image" | tr "/:" "_")" +rm -f "$image_stamp.use" +touch "$image_stamp.use" + if [ x"$rm_cnt" != x"" ]; then # With the new container started delete the old one. # Note that if both old and new containers need an exclusive resource |