{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/16392","labels_url":"https://api.github.com/repos/docker/docker/issues/16392/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/16392/comments","events_url":"https://api.github.com/repos/docker/docker/issues/16392/events","html_url":"https://github.com/docker/docker/issues/16392","id":107175994,"number":16392,"title":"Bug : docker command arguments/options error","user":{"login":"chatenilesh","id":9842748,"avatar_url":"https://avatars.githubusercontent.com/u/9842748?v=3","gravatar_id":"","url":"https://api.github.com/users/chatenilesh","html_url":"https://github.com/chatenilesh","followers_url":"https://api.github.com/users/chatenilesh/followers","following_url":"https://api.github.com/users/chatenilesh/following{/other_user}","gists_url":"https://api.github.com/users/chatenilesh/gists{/gist_id}","starred_url":"https://api.github.com/users/chatenilesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chatenilesh/subscriptions","organizations_url":"https://api.github.com/users/chatenilesh/orgs","repos_url":"https://api.github.com/users/chatenilesh/repos","events_url":"https://api.github.com/users/chatenilesh/events{/privacy}","received_events_url":"https://api.github.com/users/chatenilesh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-18T10:21:55Z","updated_at":"2015-09-18T12:32:36Z","closed_at":null,"body":"$docker run -it ds --privileged\r\nThis command ignores the --privileged option, i was not able to perform some operations in docker because of this as i needed privileged access inside my container.\r\n\r\nI tried:\r\n$docker run --privileged -it ds \r\nThis worked for me.\r\n\r\n$docker run -it ds --asd\r\nThe above command starts the container without reporting the error/warning for invalid option \"--asd\",etc.\r\n\r\nbasically the issue is:\r\nIf you provide the options after the container name those options are ignored.\r\nAt least a warning or error must be reported, i wasted 2 days because of this issue."},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/141439427","html_url":"https://github.com/docker/docker/issues/16392#issuecomment-141439427","issue_url":"https://api.github.com/repos/docker/docker/issues/16392","id":141439427,"user":{"login":"phemmer","id":1826947,"avatar_url":"https://avatars.githubusercontent.com/u/1826947?v=3","gravatar_id":"","url":"https://api.github.com/users/phemmer","html_url":"https://github.com/phemmer","followers_url":"https://api.github.com/users/phemmer/followers","following_url":"https://api.github.com/users/phemmer/following{/other_user}","gists_url":"https://api.github.com/users/phemmer/gists{/gist_id}","starred_url":"https://api.github.com/users/phemmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phemmer/subscriptions","organizations_url":"https://api.github.com/users/phemmer/orgs","repos_url":"https://api.github.com/users/phemmer/repos","events_url":"https://api.github.com/users/phemmer/events{/privacy}","received_events_url":"https://api.github.com/users/phemmer/received_events","type":"User","site_admin":false},"created_at":"2015-09-18T12:32:36Z","updated_at":"2015-09-18T12:32:36Z","body":"Unfortunately docker cannot be adjusted to behave as you wish. In the command `docker run -it ds --privileged`, the `--privileged` option is not being ignored, it is being passed to the container's entrypoint.\r\n\r\nFor example:\r\n```\r\n# cat Dockerfile \r\nFROM fedora:22\r\nENTRYPOINT [\"/bin/echo\",\"my args are:\"]\r\n\r\n# docker build -t test . \r\nSending build context to Docker daemon 2.048 kB\r\nStep 0 : FROM fedora:22\r\n ---> ded7cd95e059\r\nStep 1 : ENTRYPOINT /bin/echo my args are:\r\n ---> Running in ccf3cb9946de\r\n ---> 86bef7d2d7b8\r\nRemoving intermediate container ccf3cb9946de\r\nSuccessfully built 86bef7d2d7b8\r\n\r\n# docker run -it test --privileged\r\nmy args are: --privileged\r\n```\r\n\r\nDocker has no way of knowing that `--privileged` was erroneously provided to the container entrypoint instead of docker itself. The container might have a `--privileged` argument, and make use of it. If docker were to warn, the warning would be incorrect."}}