Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
I have enabled user namespaces and now I wanted to run a docker container with --privileged flag, yes I know it's a bad practice but still I wanted to run that docker as --privileged.
But I can see this error pops-up, so was curious what is this error? What am I doing wrong?
docker: Error response from daemon: privileged mode is incompatible to user namespaces. You must run the container in the host namespace when running privileged mode'
–
From docker docs they said:
If you enable user namespaces on the daemon, all containers are started with user namespaces enabled by default. In some situations, such as privileged containers, you may need to disable user namespaces for a specific container. To disable user namespaces for a specific container, add the
--userns=host
flag to the
docker container create
,
docker container run
, or
docker container exec
command.
docker: Error response from daemon: privileged mode is incompatible to user namespaces. You must run the container in the host namespace when running privileged mode'
It is pretty clear in the error, to run your container with
--previleged
you have to run your container in the host namespace not in the custom namespace.
–
–
Thanks for contributing an answer to Stack Overflow!
-
Please be sure to
answer the question
. Provide details and share your research!
But
avoid
…
-
Asking for help, clarification, or responding to other answers.
-
Making statements based on opinion; back them up with references or personal experience.
To learn more, see our
tips on writing great answers
.