{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/19418","labels_url":"https://api.github.com/repos/docker/docker/issues/19418/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/19418/comments","events_url":"https://api.github.com/repos/docker/docker/issues/19418/events","html_url":"https://github.com/docker/docker/issues/19418","id":127301314,"number":19418,"title":"1.10-rc1 docker run should not create container if network options are invalid","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},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/group/networking","name":"group/networking","color":"F6FBFF"},{"url":"https://api.github.com/repos/docker/docker/labels/priority/P2","name":"priority/P2","color":"fad8c7"}],"state":"open","locked":false,"assignee":{"login":"mavenugo","id":5056191,"avatar_url":"https://avatars.githubusercontent.com/u/5056191?v=3","gravatar_id":"","url":"https://api.github.com/users/mavenugo","html_url":"https://github.com/mavenugo","followers_url":"https://api.github.com/users/mavenugo/followers","following_url":"https://api.github.com/users/mavenugo/following{/other_user}","gists_url":"https://api.github.com/users/mavenugo/gists{/gist_id}","starred_url":"https://api.github.com/users/mavenugo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mavenugo/subscriptions","organizations_url":"https://api.github.com/users/mavenugo/orgs","repos_url":"https://api.github.com/users/mavenugo/repos","events_url":"https://api.github.com/users/mavenugo/events{/privacy}","received_events_url":"https://api.github.com/users/mavenugo/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/docker/docker/milestones/44","html_url":"https://github.com/docker/docker/milestones/1.10.0","labels_url":"https://api.github.com/repos/docker/docker/milestones/44/labels","id":1351533,"number":44,"title":"1.10.0","description":"Code freeze / feature freeze January 14th 2016\r\nPlanned release: February 4th, 2016\r\nhttps://github.com/docker/docker/wiki","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":29,"closed_issues":256,"state":"open","created_at":"2015-10-12T18:21:55Z","updated_at":"2016-01-21T03:36:18Z","due_on":"2016-02-04T08:00:00Z","closed_at":null},"comments":8,"created_at":"2016-01-18T20:06:30Z","updated_at":"2016-01-21T05:53:02Z","closed_at":null,"body":"Related to https://github.com/docker/docker/issues/19417\r\n\r\nDocker creates a container, even if the network options are invalid. For example;\r\n\r\n```bash\r\n# docker run --ip=172.17.0.18 -itd --net=bridge busybox sh\r\n14bed02fbc4c9901b4d562844ec3d03e7773259375a07037a2f4062ce0671b17\r\ndocker: Error response from daemon: User specified IP address is supported on user defined networks only.\r\n```\r\n\r\nThe above instruction created a container, and apparently assigned an IP-address\r\n\r\n(note that **the same** IP-address is used for each container that fails);\r\n\r\n```json\r\n\"Networks\": {\r\n    \"bridge\": {\r\n        \"IPAMConfig\": {\r\n            \"IPv4Address\": \"172.17.0.18\"\r\n        },\r\n        \"Links\": null,\r\n        \"Aliases\": null,\r\n        \"NetworkID\": \"\",\r\n        \"EndpointID\": \"\",\r\n        \"Gateway\": \"\",\r\n        \"IPAddress\": \"\",\r\n        \"IPPrefixLen\": 0,\r\n        \"IPv6Gateway\": \"\",\r\n        \"GlobalIPv6Address\": \"\",\r\n        \"GlobalIPv6PrefixLen\": 0,\r\n        \"MacAddress\": \"\"\r\n    }\r\n}\r\n```\r\n\r\n#### Expected result\r\n\r\nNo container being created if the passed options are invalid "},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/173464720","html_url":"https://github.com/docker/docker/issues/19418#issuecomment-173464720","issue_url":"https://api.github.com/repos/docker/docker/issues/19418","id":173464720,"user":{"login":"wenchma","id":8329027,"avatar_url":"https://avatars.githubusercontent.com/u/8329027?v=3","gravatar_id":"","url":"https://api.github.com/users/wenchma","html_url":"https://github.com/wenchma","followers_url":"https://api.github.com/users/wenchma/followers","following_url":"https://api.github.com/users/wenchma/following{/other_user}","gists_url":"https://api.github.com/users/wenchma/gists{/gist_id}","starred_url":"https://api.github.com/users/wenchma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wenchma/subscriptions","organizations_url":"https://api.github.com/users/wenchma/orgs","repos_url":"https://api.github.com/users/wenchma/repos","events_url":"https://api.github.com/users/wenchma/events{/privacy}","received_events_url":"https://api.github.com/users/wenchma/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T05:53:01Z","updated_at":"2016-01-21T05:53:01Z","body":"@aboch thanks for your explanation, got it `--ip` only works for `-subnet` specified.\r\nIf that, my above test cases should fail to create containers same as @thaJeztah reported this issue,\r\n@mavenugo  I think at least  the validations should happen before  a container create and start."}}