-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to deploy a docker container in "privileged" mode when user namespace is enabled for docker daemon #1904
Comments
I confirmed this bug in both 0.4.1 and 0.5-rc1 with the following: Added
Use the following nomad configuration: client {
enabled = true
options = {
"driver.raw_exec.enable" = "1"
"docker.privileged.enabled" = "true"
}
} Added the following to the example job file: config {
image = "redis:3.2"
privileged = true
uts_mode = "host"
port_map {
... We'll get this fixed for 0.5. |
I believe the docker setting you're looking for is I added |
(As always feel free to reopen if that option isn't what you needed or doesn't address your issue.) |
|
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. |
Nomad version
Nomad v0.4.1
Operating system and Environment details
Linux mo-9c187bcb3 4.2.0-27-generic #32~14.04.1-Ubuntu SMP Fri Jan 22 15:32:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Issue
According to Docker documentation: https://docs.docker.com/engine/reference/commandline/dockerd/
Disable user namespace for a container
If you enable user namespaces on the daemon, all containers are started with user namespaces enabled. In some situations you might want to disable this feature for a container, for example, to start a privileged container (see user namespace known restrictions). To enable those advanced features for a specific container use --userns=host in the run/exec/create command. This option will completely disable user namespace mapping for the container’s user.
nomad run <>.hcl with
fails with an exception :
API error (500): {"message":"Privileged mode is incompatible with user namespaces"}.
I am able to run the container in privileged mode directly like "docker run -itd --privileged --userns=host". (It does not run without the --userns=host flag). I tried adding args = ["--userns=host"] in the hcl, it still gave the error API error (500): {"message":"Privileged mode is incompatible with user namespaces"}.
Reproduction steps
client {
options = {
"driver.raw_exec.enable" = "1"
"docker.privileged.enabled" = "true"
}
privileged = true
uts_mode = "host"
Nomad Server logs (if appropriate)
failed to create container from image API error (500): {"message":"Privileged mode is incompatible with user namespaces"}
Nomad Client logs (if appropriate)
Job file (if appropriate)
config {
............................
............................
privileged = true
uts_mode = "host"
}
The text was updated successfully, but these errors were encountered: