Skip to content

Use recommended flags instead of --privileged when running a container - #24

Open
tehasdf wants to merge 1 commit into
masterfrom
no-privileged
Open

tehasdf wants to merge 1 commit into
masterfrom
no-privileged

Conversation

@tehasdf

@tehasdf tehasdf commented Jan 12, 2017

Copy link
Copy Markdown
Contributor

Using --privileged means that the container has full access to the
host machine, which is suboptimal: it's a security risk, and it allows
the container to mess with the host machine's settings (eg. for me,
it usually resets my sound volume :) ).

Instead, use more fine-grained privileges: add only the flags that
are required to run systemd (as advised by the readme of the base
image).

Note that, in the integration tests, dockercompute is not using
docker-in-docker (instead, it's connecting to the host machine's
docker), so --privileged is not required for the tests.

Also, on top of the required privileges, add NET_ADMIN so the container
can use iptables (used in clustering tests).

Using --privileged means that the container has full access to the
host machine, which is suboptimal: it's a security risk, and it allows
the container to mess with the host machine's settings (eg. for me,
it usually resets my sound volume :) ).

Instead, use more fine-grained privileges: add only the flags that
are required to run systemd (as advised by the readme of the base
image).

Note that, in the integration tests, dockercompute is not using
docker-in-docker (instead, it's connecting to the host machine's
docker), so --privileged is not required for the tests.

Also, on top of the required privileges, add NET_ADMIN so the container
can use iptables (used in clustering tests).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant