{"action":"created","issue":{"url":"https://api.github.com/repos/robbyrussell/oh-my-zsh/issues/7092","repository_url":"https://api.github.com/repos/robbyrussell/oh-my-zsh","labels_url":"https://api.github.com/repos/robbyrussell/oh-my-zsh/issues/7092/labels{/name}","comments_url":"https://api.github.com/repos/robbyrussell/oh-my-zsh/issues/7092/comments","events_url":"https://api.github.com/repos/robbyrussell/oh-my-zsh/issues/7092/events","html_url":"https://github.com/robbyrussell/oh-my-zsh/issues/7092","id":354111751,"node_id":"MDU6SXNzdWUzNTQxMTE3NTE=","number":7092,"title":"docker-compose wrong container name autocomplete","user":{"login":"iskhomutov","id":17610400,"node_id":"MDQ6VXNlcjE3NjEwNDAw","avatar_url":"https://avatars3.githubusercontent.com/u/17610400?v=4","gravatar_id":"","url":"https://api.github.com/users/iskhomutov","html_url":"https://github.com/iskhomutov","followers_url":"https://api.github.com/users/iskhomutov/followers","following_url":"https://api.github.com/users/iskhomutov/following{/other_user}","gists_url":"https://api.github.com/users/iskhomutov/gists{/gist_id}","starred_url":"https://api.github.com/users/iskhomutov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iskhomutov/subscriptions","organizations_url":"https://api.github.com/users/iskhomutov/orgs","repos_url":"https://api.github.com/users/iskhomutov/repos","events_url":"https://api.github.com/users/iskhomutov/events{/privacy}","received_events_url":"https://api.github.com/users/iskhomutov/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-26T17:16:33Z","updated_at":"2018-09-10T15:11:29Z","closed_at":"2018-09-10T15:11:29Z","author_association":"NONE","body":"Autocomplete is not working properly, if the 'container_name' property in docker-compose.yml has '_' symbol.\r\nScreenshot:\r\n![screenshot_26082018_201323](https://user-images.githubusercontent.com/17610400/44630868-cca92780-a96c-11e8-9ee3-3662d4eb50d4.png)\r\n"},"comment":{"url":"https://api.github.com/repos/robbyrussell/oh-my-zsh/issues/comments/419948730","html_url":"https://github.com/robbyrussell/oh-my-zsh/issues/7092#issuecomment-419948730","issue_url":"https://api.github.com/repos/robbyrussell/oh-my-zsh/issues/7092","id":419948730,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTk0ODczMA==","user":{"login":"mcornella","id":1441704,"node_id":"MDQ6VXNlcjE0NDE3MDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1441704?v=4","gravatar_id":"","url":"https://api.github.com/users/mcornella","html_url":"https://github.com/mcornella","followers_url":"https://api.github.com/users/mcornella/followers","following_url":"https://api.github.com/users/mcornella/following{/other_user}","gists_url":"https://api.github.com/users/mcornella/gists{/gist_id}","starred_url":"https://api.github.com/users/mcornella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcornella/subscriptions","organizations_url":"https://api.github.com/users/mcornella/orgs","repos_url":"https://api.github.com/users/mcornella/repos","events_url":"https://api.github.com/users/mcornella/events{/privacy}","received_events_url":"https://api.github.com/users/mcornella/received_events","type":"User","site_admin":false},"created_at":"2018-09-10T15:11:29Z","updated_at":"2018-09-10T15:11:29Z","author_association":"COLLABORATOR","body":"Ok, so the thing is that docker-compose's completion expects you to have defined your service's name like so\r\n```yaml\r\nversion: '2'\r\nservices:\r\n  postgres_test:\r\n    image: postgres:latest\r\n  redis_test:\r\n    image: redis:latest\r\n```\r\nThis has the effect that the real container names generated by docker-compose are of the form `${dirname}_${servicename}_${number}` so, to get the service name, the completion strips away the first and last parts separated by underscores.\r\n\r\nWhen instead you define the container_name like you did, the completion cannot get the service name from the container name, because it wasn't automatically generated.\r\n\r\nTo my knowledge there is no other solution than to not use custom container_names, or avoid completion altogether. You can open an issue on the official repo; here's a related issue https://github.com/docker/compose/pull/4313"}}
{"actor":{"display_login":"mcornella"}}