mirror of https://github.com/docker/compose.git
Better userns detection in container-script
This uses formatting to have docker info just emit the information we're interested in. Based-on-code-by: Sebastiaan van Stijn <github@gone.nl> Signed-off-by: Anton Lundin <anton.lundin@umu.se> Co-Authored-By: Sebastiaan van Stijn <thaJeztah@users.noreply.github.com>
This commit is contained in:
parent
aeddfd41d6
commit
c8cfc590cc
|
@ -56,7 +56,7 @@ DOCKER_RUN_OPTIONS="$DOCKER_RUN_OPTIONS -i"
|
|||
|
||||
|
||||
# Handle userns security
|
||||
if docker info 2>/dev/null | grep -q userns; then
|
||||
if docker info --format '{{json .SecurityOptions}}' 2>/dev/null | grep -q 'name=userns'; then
|
||||
DOCKER_RUN_OPTIONS="$DOCKER_RUN_OPTIONS --userns=host"
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue