{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/22373","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/22373/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/22373/comments","events_url":"https://api.github.com/repos/docker/docker/issues/22373/events","html_url":"https://github.com/docker/docker/pull/22373","id":151474464,"number":22373,"title":"Add new `HostConfig` field, `Mounts`.","user":{"login":"cpuguy83","id":799078,"avatar_url":"https://avatars.githubusercontent.com/u/799078?v=3","gravatar_id":"","url":"https://api.github.com/users/cpuguy83","html_url":"https://github.com/cpuguy83","followers_url":"https://api.github.com/users/cpuguy83/followers","following_url":"https://api.github.com/users/cpuguy83/following{/other_user}","gists_url":"https://api.github.com/users/cpuguy83/gists{/gist_id}","starred_url":"https://api.github.com/users/cpuguy83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpuguy83/subscriptions","organizations_url":"https://api.github.com/users/cpuguy83/orgs","repos_url":"https://api.github.com/users/cpuguy83/repos","events_url":"https://api.github.com/users/cpuguy83/events{/privacy}","received_events_url":"https://api.github.com/users/cpuguy83/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/status/3-docs-review","name":"status/3-docs-review","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/docker/docker/milestones/56","html_url":"https://github.com/docker/docker/milestones/1.13.0","labels_url":"https://api.github.com/repos/docker/docker/milestones/56/labels","id":1839404,"number":56,"title":"1.13.0","description":"","creator":{"login":"thaJeztah","id":1804568,"avatar_url":"https://avatars.githubusercontent.com/u/1804568?v=3","gravatar_id":"","url":"https://api.github.com/users/thaJeztah","html_url":"https://github.com/thaJeztah","followers_url":"https://api.github.com/users/thaJeztah/followers","following_url":"https://api.github.com/users/thaJeztah/following{/other_user}","gists_url":"https://api.github.com/users/thaJeztah/gists{/gist_id}","starred_url":"https://api.github.com/users/thaJeztah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaJeztah/subscriptions","organizations_url":"https://api.github.com/users/thaJeztah/orgs","repos_url":"https://api.github.com/users/thaJeztah/repos","events_url":"https://api.github.com/users/thaJeztah/events{/privacy}","received_events_url":"https://api.github.com/users/thaJeztah/received_events","type":"User","site_admin":false},"open_issues":73,"closed_issues":138,"state":"open","created_at":"2016-06-20T22:51:25Z","updated_at":"2016-09-12T22:52:48Z","due_on":null,"closed_at":null},"comments":39,"created_at":"2016-04-27T19:46:47Z","updated_at":"2016-09-13T10:04:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/22373","html_url":"https://github.com/docker/docker/pull/22373","diff_url":"https://github.com/docker/docker/pull/22373.diff","patch_url":"https://github.com/docker/docker/pull/22373.patch"},"body":"**- What I did**\r\nAdd capability to `/containers/create` API to specify mounts in a more granular and safer way\r\n\r\n`Mounts` allows users to specify in a much safer way the volumes they\r\nwant to use in the container.\r\n\r\n**- How I did it**\r\nAdd new field `Mounts` to HostConfig as well as new `MountConfig`\r\n\r\nThis replaces `Binds` and `Volumes`, which both still exist, but\r\n`Mounts` and `Binds`/`Volumes` are exclusive.\r\nThe CLI will continue to use `Binds` and `Volumes` due to concerns with\r\nparsing the volume specs on the client side and cross-platform support.\r\n\r\n**- How to verify it**\r\nExample usage of `Mounts`:\r\n\r\n```\r\n$ curl -XPOST localhost:2375/containers/create -d '{\r\n  \"Image\": \"alpine:latest\",\r\n  \"HostConfig\": {\r\n    \"Mounts\": [{\r\n      \"Type\": \"Volume\",\r\n      \"Destination\": \"/foo\"\r\n      },{\r\n      \"Type\": \"bind\",\r\n      \"Source\": \"/var/run/docker.sock\",\r\n      \"Destination\": \"/var/run/docker.sock\",\r\n      },{\r\n      \"Type\": \"volume\",\r\n      \"Name\": \"important_data\",\r\n      \"Target\": \"/var/data\",\r\n      \"Mode\": \"ro\"\r\n      \"Volume\": {\r\n\t\"Driver\": \"awesomeStorage\",\r\n\t\"DriverOpts\": { \"Size\": \"10G\" }\r\n\t}\r\n      }]\r\n    }\r\n}'\r\n```\r\n\r\nThere are currently 2 types of mounts:\r\n\r\n  - **bind**: Paths on the host that get mounted into the\r\n    container. Paths must exist prior to creating the container.\r\n  - **volume**: Volumes that persist after the\r\n    container is removed.\r\n\r\nNot all fields are available in each type, and validation is done to\r\nensure these fields aren't mixed up between types.\r\n\r\n**- Description for the changelog**\r\n<!--\r\nWrite a short (one line) summary that describes the changes in this\r\npull request for inclusion in the changelog:\r\n-->\r\nAdd capability to `/containers/create` API to specify mounts in a more granular and safer way\r\n\r\n**- A picture of a cute animal (not mandatory but encouraged)**\r\n![](https://s3-us-west-2.amazonaws.com/lmooweb-media/images/be564897-10f3-4e99-a15f-24a6abb896dc.jpg)\r\n"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/246634969","html_url":"https://github.com/docker/docker/pull/22373#issuecomment-246634969","issue_url":"https://api.github.com/repos/docker/docker/issues/22373","id":246634969,"user":{"login":"thaJeztah","id":1804568,"avatar_url":"https://avatars.githubusercontent.com/u/1804568?v=3","gravatar_id":"","url":"https://api.github.com/users/thaJeztah","html_url":"https://github.com/thaJeztah","followers_url":"https://api.github.com/users/thaJeztah/followers","following_url":"https://api.github.com/users/thaJeztah/following{/other_user}","gists_url":"https://api.github.com/users/thaJeztah/gists{/gist_id}","starred_url":"https://api.github.com/users/thaJeztah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thaJeztah/subscriptions","organizations_url":"https://api.github.com/users/thaJeztah/orgs","repos_url":"https://api.github.com/users/thaJeztah/repos","events_url":"https://api.github.com/users/thaJeztah/events{/privacy}","received_events_url":"https://api.github.com/users/thaJeztah/received_events","type":"User","site_admin":false},"created_at":"2016-09-13T10:04:44Z","updated_at":"2016-09-13T10:04:44Z","body":"One comment w.r.t. docs; @cpuguy83 let me know if you want to address that in this PR or a follow up"}}
{"actor":{"display_login":"thaJeztah"}}