Skip to content
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

Docker requires "Privileged" for some operations #305

Closed
treydock opened this issue Jun 11, 2014 · 3 comments
Closed

Docker requires "Privileged" for some operations #305

treydock opened this issue Jun 11, 2014 · 3 comments

Comments

@treydock
Copy link
Contributor

Using the Docker hypervisor support I've found that a container needs to be set with "Privileged" => true during creation or some parts of the tests will alway fail, such as creating iptables rules.

Example using centos6:centos based container

Error: Could not prefetch firewall provider 'iptables': Execution of '/sbin/iptables-save' returned 1: FATAL: Could not load /lib/modules/3.5.0-51-generic/modules.dep: No such file or directory
iptables-save v1.4.7: Cannot initialize: Permission denied (you must be root)

After applying this change, these errors are no more.

--- a/lib/beaker/hypervisor/docker.rb
+++ b/lib/beaker/hypervisor/docker.rb
@@ -32,7 +32,7 @@ module Beaker
         })

         @logger.debug("Starting container #{container.id}")
-        container.start({"PublishAllPorts" => true})
+        container.start({"PublishAllPorts" => true, "Privileged" => true})

         # Find out where the ssh port is from the container
         ip   = container.json["NetworkSettings"]["Ports"]["22/tcp"][0]["HostIp"]

Should this be a new option for the docker hypervisor, with default remaining 'false' for backwards compatibility, or would setting this 'true' be considered a bug fix?

treydock pushed a commit to treydock/beaker that referenced this issue Jun 16, 2014
treydock pushed a commit to treydock/beaker that referenced this issue Jun 17, 2014
treydock pushed a commit to treydock/beaker that referenced this issue Jun 17, 2014
anodelman pushed a commit that referenced this issue Jun 17, 2014
(gh-305) Start docker containers using privileged mode
@electrical
Copy link
Contributor

This issue can be closed now its merged?

@treydock
Copy link
Contributor Author

Yes, closing.

@hackndoes
Copy link

in what version of docker was it released?

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

No branches or pull requests

3 participants