summaryrefslogtreecommitdiffstats
path: root/ansible/test/molecule-docker/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/test/molecule-docker/build.sh')
-rwxr-xr-xansible/test/molecule-docker/build.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/ansible/test/molecule-docker/build.sh b/ansible/test/molecule-docker/build.sh
index 0b65f2a7..b613e466 100755
--- a/ansible/test/molecule-docker/build.sh
+++ b/ansible/test/molecule-docker/build.sh
@@ -20,6 +20,7 @@
SCRIPT_DIR=$(dirname "${0}")
LOCAL_PATH=$(readlink -f "$SCRIPT_DIR")
+if [ $(id -u ${USER}) -eq "0" ]; then DOCKER_USER="root"; else DOCKER_USER="molecule"; fi
set -e
@@ -27,6 +28,7 @@ docker build \
--build-arg USER_ID=$(id -u ${USER}) \
--build-arg GROUP_ID=$(id -g ${USER}) \
--build-arg DOCKER_GROUP_ID=$(getent group docker | cut -f 3 -d ':') \
+ --build-arg DOCKER_USER=${DOCKER_USER} \
-t molecule-dev:2.20.0 \
${LOCAL_PATH}