From f98a1ec2c8bf99915219db5987e8c648bfdd0dda Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 18 Jun 2020 10:50:24 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20run:=20XXX=20Work=20around=20pod?= =?UTF-8?q?man=20vs=20docker=20uid=20behaviour?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/run b/run index 14277a2..7fbf16d 100755 --- a/run +++ b/run @@ -9,13 +9,22 @@ if echo "$DOCKER_IMAGE" | grep -q "/"; then docker pull "$DOCKER_IMAGE" fi + +# XXX Work around podman vs docker uid behaviour +if docker -v 2>&1 | grep -q podman; then + user="0:0" +else + user="`id -u`:`id -g`" +fi + + # 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 run --privileged=true --rm -t \ \ - --user `id -u`:`id -g` \ + --user $user \ --mount type=bind,src="$(pwd)",target=/data \ \ -e LOG_LEVEL=$LOG_LEVEL \