asdas
asdas

Reputation: 83

docker-compose and user namespaces

It is known how to use user namespace with docker. Is it possible to use it with docker-compose? I mean:

service:
  - user-namespace: true

or someting like that?

Upvotes: 6

Views: 14815

Answers (2)

BMitch
BMitch

Reputation: 264761

User namespaces are configured at the docker daemon level, not on individual containers. There's no option to opt an individual container into user namespaces. The most you can do is disable user namespaces for a single container when the daemon is running with user namespaces by setting --userns to 'host', or in compose to set userns_mode: host. Since docker-compose and docker stack deploy are used to configure containers and not the daemon, there's no option to enable this setting from your docker-compose.yml.

Upvotes: 6

yamenk
yamenk

Reputation: 51866

There doesn't seem to be an option to active user namespace in docker compose. There is the userns_mode property which can be used to disable user namespace using userns_mode: "host"

The username space feature can be enabled on the docker deamon which will be used by docker-compose when starting the containers.

Upvotes: 6

Related Questions