mirror of
https://github.com/docker/compose.git
synced 2026-08-27 03:45:29 +00:00
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
1 changed files with 1 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue