{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/10348","labels_url":"https://api.github.com/repos/docker/docker/issues/10348/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/10348/comments","events_url":"https://api.github.com/repos/docker/docker/issues/10348/events","html_url":"https://github.com/docker/docker/issues/10348","id":55461646,"number":10348,"title":"Privileged mode for docker exec","user":{"login":"bobrik","id":89186,"avatar_url":"https://avatars.githubusercontent.com/u/89186?v=3","gravatar_id":"","url":"https://api.github.com/users/bobrik","html_url":"https://github.com/bobrik","followers_url":"https://api.github.com/users/bobrik/followers","following_url":"https://api.github.com/users/bobrik/following{/other_user}","gists_url":"https://api.github.com/users/bobrik/gists{/gist_id}","starred_url":"https://api.github.com/users/bobrik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobrik/subscriptions","organizations_url":"https://api.github.com/users/bobrik/orgs","repos_url":"https://api.github.com/users/bobrik/repos","events_url":"https://api.github.com/users/bobrik/events{/privacy}","received_events_url":"https://api.github.com/users/bobrik/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/kind/feature","name":"kind/feature","color":"AAB3AB"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-01-26T09:30:38Z","updated_at":"2015-06-19T06:54:20Z","closed_at":"2015-05-26T20:32:39Z","body":"```\r\nContainers: 29\r\nImages: 294\r\nStorage Driver: overlay\r\nExecution Driver: native-0.2\r\nKernel Version: 3.18.1-031801-generic\r\nOperating System: Ubuntu 14.04.1 LTS\r\nCPUs: 2\r\nTotal Memory: 3.791 GiB\r\nName: callisto\r\nID: ZWU6:UVBQ:HL5R:AAB5:GKYQ:2MSR:UPQW:TN6H:32C4:JJFX:WLWA:YPNZ\r\nUsername: bobrik\r\nRegistry: [https://index.docker.io/v1/]\r\nWARNING: No swap limit support\r\n```\r\n\r\nRunning container as usual:\r\n\r\n```\r\ndocker run --rm -it ubuntu:14.04\r\n```\r\n\r\nUsing `docker-exec` from @jpetazzo to enter the container, trying to use `strace` (it works):\r\n\r\n```\r\nroot@callisto ~ $ docker-enter 3980451ef011\r\n-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)\r\nroot@3980451ef011:/# strace -f -p 1\r\nProcess 1 attached\r\nread(0,\r\n```\r\n\r\nTrying `docker exec` (getting `Operation not permitted` for `ptrace`):\r\n\r\n```\r\n~ λ docker exec -it 3980451ef011 /bin/bash\r\nroot@3980451ef011:/# strace -f -p 1\r\nstrace: attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted\r\nCould not attach to process.  If your uid matches the uid of the target\r\nprocess, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try\r\nagain as the root user.  For more details, see /etc/sysctl.d/10-ptrace.conf\r\n```\r\n\r\nIt would be great to have something like `--privileged` flag for `docker exec` to run commands like `strace` in container. This battery should be included, if you know what I mean."},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/113398808","html_url":"https://github.com/docker/docker/issues/10348#issuecomment-113398808","issue_url":"https://api.github.com/repos/docker/docker/issues/10348","id":113398808,"user":{"login":"tjdett","id":437845,"avatar_url":"https://avatars.githubusercontent.com/u/437845?v=3","gravatar_id":"","url":"https://api.github.com/users/tjdett","html_url":"https://github.com/tjdett","followers_url":"https://api.github.com/users/tjdett/followers","following_url":"https://api.github.com/users/tjdett/following{/other_user}","gists_url":"https://api.github.com/users/tjdett/gists{/gist_id}","starred_url":"https://api.github.com/users/tjdett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjdett/subscriptions","organizations_url":"https://api.github.com/users/tjdett/orgs","repos_url":"https://api.github.com/users/tjdett/repos","events_url":"https://api.github.com/users/tjdett/events{/privacy}","received_events_url":"https://api.github.com/users/tjdett/received_events","type":"User","site_admin":false},"created_at":"2015-06-19T06:54:20Z","updated_at":"2015-06-19T06:54:20Z","body":"This was reverted by #13491. Reopen please.\r\n"}}