Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit a2f56ac

Browse files
author
Mano Marks
authored
Merge pull request #387 from stefanlasiewski/patch-2
--privileged can be used with user namespaces
2 parents 4630b45 + 32ff99e commit a2f56ac

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

security/userns/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,13 @@ In this step you'll see how to implement user namespaces.
151151
See 'docker run --help'.
152152
```
153153

154-
As stated in the error response, *privileged* containers are not currently supported with user namespaces.
154+
As stated in the error response, *privileged* containers are not currently supported with user namespaces. But user namespaces for a container can be disabled by using the 'host' user namespace:
155+
156+
```
157+
ubuntu@node:~$ sudo docker run --rm --privileged --userns=host alpine id
158+
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video)
159+
ubuntu@node:~$
160+
```
155161

156162
6. Start a new container in interactive mode and mount the Docker Host's `/bin` directory as a volume.
157163

0 commit comments

Comments
 (0)