{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/15959","labels_url":"https://api.github.com/repos/docker/docker/issues/15959/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/15959/comments","events_url":"https://api.github.com/repos/docker/docker/issues/15959/events","html_url":"https://github.com/docker/docker/issues/15959","id":104097260,"number":15959,"title":"Docker build should support chattr","user":{"login":"tchk1228","id":13026009,"avatar_url":"https://avatars.githubusercontent.com/u/13026009?v=3","gravatar_id":"","url":"https://api.github.com/users/tchk1228","html_url":"https://github.com/tchk1228","followers_url":"https://api.github.com/users/tchk1228/followers","following_url":"https://api.github.com/users/tchk1228/following{/other_user}","gists_url":"https://api.github.com/users/tchk1228/gists{/gist_id}","starred_url":"https://api.github.com/users/tchk1228/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchk1228/subscriptions","organizations_url":"https://api.github.com/users/tchk1228/orgs","repos_url":"https://api.github.com/users/tchk1228/repos","events_url":"https://api.github.com/users/tchk1228/events{/privacy}","received_events_url":"https://api.github.com/users/tchk1228/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":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-31T17:35:17Z","updated_at":"2015-09-17T08:03:18Z","closed_at":null,"body":"I want to chattr custom /bin/uname and /bin/arch files and make sure they don't get replaced later by setting the immutable flag on them during the build step.  Currently, I think this can only be done by using \"docker run --privileged\" which would be hacky to do as part of my image build process.\r\n\r\ndocker version\r\nClient version: 1.6.2\r\nClient API version: 1.18\r\nGo version (client): go1.4.2\r\nGit commit (client): ba1f6c3/1.6.2\r\nOS/Arch (client): linux/amd64\r\nServer version: 1.6.2\r\nServer API version: 1.18\r\nGo version (server): go1.4.2\r\nGit commit (server): ba1f6c3/1.6.2\r\nOS/Arch (server): linux/amd64\r\n\r\ndocker info\r\nContainers: 39\r\nImages: 106\r\nStorage Driver: devicemapper\r\n Pool Name: docker-253:1-1175046-pool\r\n Pool Blocksize: 65.54 kB\r\n Backing Filesystem: extfs\r\n Data file: /dev/loop1\r\n Metadata file: /dev/loop2\r\n Data Space Used: 7.254 GB\r\n Data Space Total: 107.4 GB\r\n Data Space Available: 14.51 GB\r\n Metadata Space Used: 10.8 MB\r\n Metadata Space Total: 2.147 GB\r\n Metadata Space Available: 2.137 GB\r\n Udev Sync Supported: true\r\n Data loop file: /media/docker/lib/docker/devicemapper/devicemapper/data\r\n Metadata loop file: /media/docker/lib/docker/devicemapper/devicemapper/metadata\r\n Library Version: 1.02.93-RHEL7 (2015-01-28)\r\nExecution Driver: native-0.2\r\nKernel Version: 3.10.0-123.el7.x86_64\r\nOperating System: CentOS Linux 7 (Core)\r\nCPUs: 1\r\nTotal Memory: 1.798 GiB\r\nName: builder\r\nID: UDUT:CUP5:KCRC:QMZ7:MPH3:CM3D:5JE7:ASC3:T2QC:ILQZ:65HF:GZX6\r\n\r\nuname -a\r\nLinux builder 3.10.0-123.el7.x86_64 #1 SMP Mon Jun 30 12:09:22 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux\r\n\r\ncat Dockerfile\r\nFROM busybox\r\nRUN chattr +i /bin/uname\r\n\r\ndocker build -t asdf ./\r\nSending build context to Docker daemon 2.048 kB\r\nSending build context to Docker daemon\r\nStep 0 : FROM busybox\r\n ---> 8c2e06607696\r\nStep 1 : RUN chattr +i /bin/uname\r\n ---> Running in 45d5d3a99246\r\nchattr: setting flags on /bin/uname: Operation not permitted\r\n ---> c39f3e7f364c\r\nRemoving intermediate container 45d5d3a99246\r\nSuccessfully built c39f3e7f364c\r\n\r\ndocker run --rm asdf lsattr /bin/uname\r\n------------- /bin/uname\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/140997993","html_url":"https://github.com/docker/docker/issues/15959#issuecomment-140997993","issue_url":"https://api.github.com/repos/docker/docker/issues/15959","id":140997993,"user":{"login":"wulonghui","id":5194128,"avatar_url":"https://avatars.githubusercontent.com/u/5194128?v=3","gravatar_id":"","url":"https://api.github.com/users/wulonghui","html_url":"https://github.com/wulonghui","followers_url":"https://api.github.com/users/wulonghui/followers","following_url":"https://api.github.com/users/wulonghui/following{/other_user}","gists_url":"https://api.github.com/users/wulonghui/gists{/gist_id}","starred_url":"https://api.github.com/users/wulonghui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wulonghui/subscriptions","organizations_url":"https://api.github.com/users/wulonghui/orgs","repos_url":"https://api.github.com/users/wulonghui/repos","events_url":"https://api.github.com/users/wulonghui/events{/privacy}","received_events_url":"https://api.github.com/users/wulonghui/received_events","type":"User","site_admin":false},"created_at":"2015-09-17T08:03:18Z","updated_at":"2015-09-17T08:03:18Z","body":"I also have this issue,  any solution?"}}