{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/23050","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/23050/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/23050/comments","events_url":"https://api.github.com/repos/docker/docker/issues/23050/events","html_url":"https://github.com/docker/docker/issues/23050","id":157164922,"number":23050,"title":"Docker Create remote API documentation mystifying","user":{"login":"cefn","id":159819,"avatar_url":"https://avatars.githubusercontent.com/u/159819?v=3","gravatar_id":"","url":"https://api.github.com/users/cefn","html_url":"https://github.com/cefn","followers_url":"https://api.github.com/users/cefn/followers","following_url":"https://api.github.com/users/cefn/following{/other_user}","gists_url":"https://api.github.com/users/cefn/gists{/gist_id}","starred_url":"https://api.github.com/users/cefn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cefn/subscriptions","organizations_url":"https://api.github.com/users/cefn/orgs","repos_url":"https://api.github.com/users/cefn/repos","events_url":"https://api.github.com/users/cefn/events{/privacy}","received_events_url":"https://api.github.com/users/cefn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/kind/docs","name":"kind/docs","color":"A8E6CE"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-05-27T09:21:50Z","updated_at":"2016-06-07T18:02:34Z","closed_at":null,"body":"Given there are apparently duplicate properties at the options level and HostConfig level the lack of documentation for the containers/create endpoint in the [Remote API](https://docs.docker.com/engine/reference/api/docker_remote_api_v1.23/#create-a-container) is a blocker.\r\n\r\nIn particular, without deep knowledge of the system, how are adopters supposed to differentiate between...\r\n\r\n```options.Volumes``` vs. ```options.HostConfig.Binds```\r\n\r\n...or...\r\n\r\n```options.ExposedPorts``` vs. ```options.HostConfig.PortBindings```\r\n \r\n...as they appear to be doing the same thing. Probably they are not, but really as [noted before](https://github.com/docker/docker/issues/2949) in an issue not properly closed according to those in the thread, these things are NOT self-describing. If the conventions correspond to equivalent operations documented elsewhere, then this link should be explicit.\r\n\r\nHostConfig is not even labelled - what does it do? Isn't the whole JSON-ish structure a host configuration? This is particularly galling since the /run endpoint describes that it 'takes a HostConfig' for backwards compatibility, and links to the documentation for containers/create to clarify, where there is no information describing what the HostConfig object is for, (versus the whole options object, which contains a bunch of host-specific config).\r\n\r\nBACKGROUND\r\n\r\nI am trying to execute through the Remote API a self-removing (--rm) container configuration already verified interactively through a command line ```docker run``` invocation. I can't be the only person who works in this way, starting with docker run, and then trying to use an API to automate invocation. \r\n\r\nMy attempt to code this through dockerode (backed by the Remote API) very challenging simply because the documentation is so poor (dockerode points to the Remote API documentation as documentation for its own API). "},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/224363597","html_url":"https://github.com/docker/docker/issues/23050#issuecomment-224363597","issue_url":"https://api.github.com/repos/docker/docker/issues/23050","id":224363597,"user":{"login":"cefn","id":159819,"avatar_url":"https://avatars.githubusercontent.com/u/159819?v=3","gravatar_id":"","url":"https://api.github.com/users/cefn","html_url":"https://github.com/cefn","followers_url":"https://api.github.com/users/cefn/followers","following_url":"https://api.github.com/users/cefn/following{/other_user}","gists_url":"https://api.github.com/users/cefn/gists{/gist_id}","starred_url":"https://api.github.com/users/cefn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cefn/subscriptions","organizations_url":"https://api.github.com/users/cefn/orgs","repos_url":"https://api.github.com/users/cefn/repos","events_url":"https://api.github.com/users/cefn/events{/privacy}","received_events_url":"https://api.github.com/users/cefn/received_events","type":"User","site_admin":false},"created_at":"2016-06-07T18:02:33Z","updated_at":"2016-06-07T18:02:33Z","body":"I note also that the solution proposed at https://github.com/apocas/dockerode/issues/48 seems to have a mismatch between Config and HostConfig, as detailed at https://godoc.org/github.com/docker/engine-api/types/container#Config and https://godoc.org/github.com/docker/engine-api/types/container#HostConfig as it assigns PortBindings to the Config object instead of the HostConfig object. \r\n\r\nThis assumes I've understood correctly that Config is equivalent to the top level dockerode 'options' structure and HostConfig is equivalent to the HostConfig property of the dockerode 'options' structure respectively.\r\n\r\nHowever, I think I've now tried every combination of assigning PortBindings and ExposedPorts to the options and options.HostConfig with no joy so far (and no error feedback either), although Dockerode claims that all the values are just passed on to the Remote API, so I think I'm still looking in the right place for the solution.."}}
{"actor":{"display_login":"cefn"}}