{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/18701","labels_url":"https://api.github.com/repos/docker/docker/issues/18701/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/18701/comments","events_url":"https://api.github.com/repos/docker/docker/issues/18701/events","html_url":"https://github.com/docker/docker/issues/18701","id":122450123,"number":18701,"title":"Proposal: Add support to mount an image or a container","user":{"login":"zhuguihua","id":10684890,"avatar_url":"https://avatars.githubusercontent.com/u/10684890?v=3","gravatar_id":"","url":"https://api.github.com/users/zhuguihua","html_url":"https://github.com/zhuguihua","followers_url":"https://api.github.com/users/zhuguihua/followers","following_url":"https://api.github.com/users/zhuguihua/following{/other_user}","gists_url":"https://api.github.com/users/zhuguihua/gists{/gist_id}","starred_url":"https://api.github.com/users/zhuguihua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhuguihua/subscriptions","organizations_url":"https://api.github.com/users/zhuguihua/orgs","repos_url":"https://api.github.com/users/zhuguihua/repos","events_url":"https://api.github.com/users/zhuguihua/events{/privacy}","received_events_url":"https://api.github.com/users/zhuguihua/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-12-16T08:09:50Z","updated_at":"2016-01-18T08:55:36Z","closed_at":"2016-01-18T08:55:36Z","body":"# Background\r\nCurrently, image handling is based on\r\n* Works inside a container with a shell or other tools\r\n* Copy file from host\r\n\r\n# Problems\r\n* Application container maybe not contains a shell or other tools\r\n* Copy file from host implies dependencies from container to host\r\n\r\n# Design\r\nWe will realize a feature similar to libguestfs.\r\n* Create a new sub command \"mount\" in docker.\r\n   * Usage: docker mount  IMAGE|CONTAINER  mountPath\r\n   * If container is not in stop state, or image is in use, mount operation will fail.\r\n   * If container or image is in mounted state, some operations like start, push, commit will fail, and docker daemon will output the error message.\r\n   * Files in image or container will be mounted to the given mount path. The default mount path is /var/lib/docker/file/\r\n   * The image or container will be mounted read-only, and we will add a new rw layer based on it.\r\n   * User can add, delete, modify files at the mount point.\r\n\r\n* Create a new sub command \"unmount\" in docker.\r\n   * Usage: docker unmount IMAGE|CONTAINER\r\n   * For image, we will untag the original image, then commit a new image which contains the added rw layer with the original image's tag.\r\n   * For container, we will combine the original rw layer of container with the added new one."},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/172467102","html_url":"https://github.com/docker/docker/issues/18701#issuecomment-172467102","issue_url":"https://api.github.com/repos/docker/docker/issues/18701","id":172467102,"user":{"login":"unclejack","id":1409668,"avatar_url":"https://avatars.githubusercontent.com/u/1409668?v=3","gravatar_id":"","url":"https://api.github.com/users/unclejack","html_url":"https://github.com/unclejack","followers_url":"https://api.github.com/users/unclejack/followers","following_url":"https://api.github.com/users/unclejack/following{/other_user}","gists_url":"https://api.github.com/users/unclejack/gists{/gist_id}","starred_url":"https://api.github.com/users/unclejack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unclejack/subscriptions","organizations_url":"https://api.github.com/users/unclejack/orgs","repos_url":"https://api.github.com/users/unclejack/repos","events_url":"https://api.github.com/users/unclejack/events{/privacy}","received_events_url":"https://api.github.com/users/unclejack/received_events","type":"User","site_admin":false},"created_at":"2016-01-18T08:55:36Z","updated_at":"2016-01-18T08:55:36Z","body":"Images aren't supposed to be modified. Images are meant to be immutable and containers are supposed to be mutable.\r\n\r\nThe right way to modify an image is to create a container using that image, make any desired changes to the container and commit that container as a new image.\r\n\r\nAdditionally, images can also be edited using export and import.\r\n\r\nAdding new top level commands such as `mount` and `unmount` won't happen as that's not needed. Having more than one way to do the exact same thing which has been there for a long time is overkill."}}