From 0d61c258a6824487e3f551601938dc317ce2eb59 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Mon, 2 Mar 2020 16:57:24 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Support=20running=20a=20stable=20ve?= =?UTF-8?q?rsion=20from=20Docker=20Hub?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run | 8 +++++++- run-docker-hub | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100755 run-docker-hub diff --git a/run b/run index 1dbde1c..ecc20ed 100755 --- a/run +++ b/run @@ -5,10 +5,16 @@ # /home on SELinux secured systems such as Fedora. We might want to use udica # instead in the future. +DOCKER_IMAGE=my_ocrd_workflow:latest # locally built + +if echo "$DOCKER_IMAGE" | grep -q "/"; then + docker pull "$DOCKER_IMAGE" +fi + docker run --privileged=true --rm -t \ \ --user `id -u`:`id -g` \ --mount type=bind,src="$(pwd)",target=/data \ \ -e LOG_LEVEL=$LOG_LEVEL \ - my_ocrd_workflow + $DOCKER_IMAGE diff --git a/run-docker-hub b/run-docker-hub new file mode 100755 index 0000000..8295525 --- /dev/null +++ b/run-docker-hub @@ -0,0 +1,20 @@ +#!/bin/sh +# Run the my_ocrd_workflow container on the current workspace + +# The container currently needs to run privileged to allow it to read from e.g. +# /home on SELinux secured systems such as Fedora. We might want to use udica +# instead in the future. + +DOCKER_IMAGE=mikegerber/my_ocrd_workflow:stable + +if echo "$DOCKER_IMAGE" | grep -q "/"; then + docker pull "$DOCKER_IMAGE" +fi + +docker run --privileged=true --rm -t \ + \ + --user `id -u`:`id -g` \ + --mount type=bind,src="$(pwd)",target=/data \ + \ + -e LOG_LEVEL=$LOG_LEVEL \ + $DOCKER_IMAGE