{"action":"closed","issue":{"url":"https://api.github.com/repos/mitchellh/packer/issues/3438","repository_url":"https://api.github.com/repos/mitchellh/packer","labels_url":"https://api.github.com/repos/mitchellh/packer/issues/3438/labels{/name}","comments_url":"https://api.github.com/repos/mitchellh/packer/issues/3438/comments","events_url":"https://api.github.com/repos/mitchellh/packer/issues/3438/events","html_url":"https://github.com/mitchellh/packer/issues/3438","id":148459316,"number":3438,"title":"Packer Docker builder, not accepting -v foo:/bar","user":{"login":"Purple90","id":7786505,"avatar_url":"https://avatars.githubusercontent.com/u/7786505?v=3","gravatar_id":"","url":"https://api.github.com/users/Purple90","html_url":"https://github.com/Purple90","followers_url":"https://api.github.com/users/Purple90/followers","following_url":"https://api.github.com/users/Purple90/following{/other_user}","gists_url":"https://api.github.com/users/Purple90/gists{/gist_id}","starred_url":"https://api.github.com/users/Purple90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Purple90/subscriptions","organizations_url":"https://api.github.com/users/Purple90/orgs","repos_url":"https://api.github.com/users/Purple90/repos","events_url":"https://api.github.com/users/Purple90/events{/privacy}","received_events_url":"https://api.github.com/users/Purple90/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-14T19:29:01Z","updated_at":"2016-04-14T20:13:18Z","closed_at":"2016-04-14T20:13:18Z","body":"FOR BUGS:\r\n\r\nDescribe the problem and include the following information:\r\n\r\n- Packer Version - 0.9.0\r\n- Host platform - Centos 7.2\r\n\r\nI am trying to provision a docker container, and I need the container to have /lib/modules mounted to /lib/modules in the container. Whats strange is when I run the docker run command that Packer says its running, I am able to start the container and do what I need to do. \r\n\r\nMy Docker command that works - \r\n`docker run --privileged -t -i --net=host -v /lib/modules:/lib/modules 9a8c6ee5e82a /bin/bash -c 'sudo /sbin/service iptables restart'\r\n`\r\nPart of the template concerning this\r\n`{\r\n  \"builders\": [{\r\n    \"type\": \"docker\",\r\n    \"image\": \"my-img\",\r\n    \"pull\": false,\r\n    \"export_path\": \"docker-march.tar\",\r\n    \"run_command\": [\r\n        \"--privileged\",\r\n        \"-d\",\r\n        \"-i\",\r\n        \"-t\",\r\n        \"--net=host\",\r\n        \"-v /lib/modules:/lib/modules\",\r\n        \"{{.Image}}\",\r\n        \"/bin/sh\"\r\n        ]\r\n  }],`\r\n\r\nAnd the error\r\n`==> docker: Error running container: Docker exited with a non-zero exit status.\r\n==> docker: Stderr: flag provided but not defined: -v /lib/modules:/lib/modules`\r\n\r\nThis is what it says its running\r\n`docker: Run command: docker run -v /home/my-user/.packer.d/tmp/packer-docker780723700:/packer-files --privileged -d -i -t --net=host -v /lib/modules:/lib/modules top-rhel6-base /bin/sh`\r\n\r\nWhich when I run manually, works. "}}