{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/15908","labels_url":"https://api.github.com/repos/docker/docker/issues/15908/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/15908/comments","events_url":"https://api.github.com/repos/docker/docker/issues/15908/events","html_url":"https://github.com/docker/docker/issues/15908","id":103719329,"number":15908,"title":"Creating container via remote API with data volume specification causes error","user":{"login":"barsteadr","id":4014082,"avatar_url":"https://avatars.githubusercontent.com/u/4014082?v=3","gravatar_id":"","url":"https://api.github.com/users/barsteadr","html_url":"https://github.com/barsteadr","followers_url":"https://api.github.com/users/barsteadr/followers","following_url":"https://api.github.com/users/barsteadr/following{/other_user}","gists_url":"https://api.github.com/users/barsteadr/gists{/gist_id}","starred_url":"https://api.github.com/users/barsteadr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barsteadr/subscriptions","organizations_url":"https://api.github.com/users/barsteadr/orgs","repos_url":"https://api.github.com/users/barsteadr/repos","events_url":"https://api.github.com/users/barsteadr/events{/privacy}","received_events_url":"https://api.github.com/users/barsteadr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-28T13:30:10Z","updated_at":"2015-09-04T14:21:34Z","closed_at":"2015-08-28T13:47:28Z","body":"## uname -a\r\n`Linux rjb 3.19.0-26-generic #28~14.04.1-Ubuntu SMP Wed Aug 12 14:09:17 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux`\r\n\r\n## docker version\r\n```Client:\r\n Version:      1.8.1\r\n API version:  1.20\r\n Go version:   go1.4.2\r\n Git commit:   d12ea79\r\n Built:        Thu Aug 13 02:35:49 UTC 2015\r\n OS/Arch:      linux/amd64\r\n\r\nServer:\r\n Version:      1.8.1\r\n API version:  1.20\r\n Go version:   go1.4.2\r\n Git commit:   d12ea79\r\n Built:        Thu Aug 13 02:35:49 UTC 2015\r\n OS/Arch:      linux/amd64\r\n```\r\n\r\n##  docker info\r\n```\r\nContainers: 2\r\nImages: 51\r\nStorage Driver: aufs\r\n Root Dir: /var/lib/docker/aufs\r\n Backing Filesystem: extfs\r\n Dirs: 55\r\n Dirperm1 Supported: true\r\nExecution Driver: native-0.2\r\nLogging Driver: json-file\r\nKernel Version: 3.19.0-26-generic\r\nOperating System: Ubuntu 14.04.3 LTS\r\nCPUs: 2\r\nTotal Memory: 5.813 GiB\r\nName: rjb\r\nID: U3PM:6Q7Q:4N54:TB2L:N4OR:BU2J:H4LE:XUAP:IAUO:H5VM:5LWB:JVJZ\r\nWARNING: No swap limit support\r\n```\r\n\r\n#### Environment details: \r\n`VMWare Fusion V8`\r\n\r\n#### How reproducible: \r\n`Fails every time`\r\n\r\n\r\n#### Steps to Reproduce:\r\n1. run:\r\n `docker pull ubuntu:14.04`\r\n2. Submit a POST call: \r\n`curl -XPOST localhost:4243/containers/create?name=dockerdata -H \"Content-Type:application/json\" -d '{\"Image\": \"ubuntu:14.04\", \"Hostconfig\": {\"Binds\": [\"/var/www\"] }  }'`\r\n\r\n#### Actual Results: \r\n1. Error: `Invalid volume specification: /var/www`\r\n2. No volume mounts reported for the container\r\n\r\n#### Expected Results:\r\nExpected something like the following when inspecting the container\r\n```\r\n    \"Mounts\": [\r\n        {\r\n            \"Name\": \"67bfe6dca71...\",\r\n            \"Source\": \"/var/lib/docker/volumes/67bfe6dca71.../_data\",\r\n            \"Destination\": \"/var/www\",\r\n            \"Driver\": \"local\",\r\n            \"Mode\": \"\",\r\n            \"RW\": true\r\n        }\r\n```\r\n\r\n#### Additional info:\r\nThe same issue was reported [here](https://github.com/docker/docker/issues/13786) for Docker V1.6\r\n\r\nI'm attempting to create a data volume container.\r\n\r\nExpectations come from the Documentation: \r\nCreates a container with /fakedir shareable volume based on https://docs.docker.com/reference/api/docker_remote_api_v1.18/#create-a-container:\r\n\"Binds – A list of volume bindings for this container. Each volume binding is a string of the form container_path (to create a new volume for the container), host_path:container_path (to bind-mount a host path into the container), or host_path:container_path:ro (to make the bind-mount read-only inside the container).\"\r\n\r\nFinally, the expected behavior is obtained when not using the remote API. Running this command:\r\n`docker create -v /var/www --name dockerdata ubuntu:14.04 /bin/true` \r\nleads to the desired result.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/137749134","html_url":"https://github.com/docker/docker/issues/15908#issuecomment-137749134","issue_url":"https://api.github.com/repos/docker/docker/issues/15908","id":137749134,"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},"created_at":"2015-09-04T14:21:34Z","updated_at":"2015-09-04T14:21:34Z","body":"The syntax I pasted is correct, however:\r\n```\r\n$ curl -XPOST -H 'Content-Type: application/json' localhost/containers/create?name=foo -d '{\"Image\": \"busybox\", \"Volumes\": { \"/foo\": {}}}'\r\n$ docker inspect -f '{{ json .Mounts }}' foo | jq .\r\n[\r\n  {\r\n    \"RW\": true,\r\n    \"Mode\": \"\",\r\n    \"Driver\": \"local\",\r\n    \"Destination\": \"/foo\",\r\n    \"Source\": \"/var/lib/docker/volumes/9b2a28e96e288b674e9b8ef0b645af7696d31f43c761ac44bd33e3a3a661a833/_data\",\r\n    \"Name\": \"9b2a28e96e288b674e9b8ef0b645af7696d31f43c761ac44bd33e3a3a661a833\"\r\n  }\r\n]\r\n```"}}