{"action":"created","issue":{"url":"https://api.github.com/repos/docker/compose/issues/5934","repository_url":"https://api.github.com/repos/docker/compose","labels_url":"https://api.github.com/repos/docker/compose/issues/5934/labels{/name}","comments_url":"https://api.github.com/repos/docker/compose/issues/5934/comments","events_url":"https://api.github.com/repos/docker/compose/issues/5934/events","html_url":"https://github.com/docker/compose/issues/5934","id":319963443,"number":5934,"title":"docker-compose doesn't work from inside a windows container with a named pipe mounted from the host","user":{"login":"alex-codefresh","id":33512662,"avatar_url":"https://avatars0.githubusercontent.com/u/33512662?v=4","gravatar_id":"","url":"https://api.github.com/users/alex-codefresh","html_url":"https://github.com/alex-codefresh","followers_url":"https://api.github.com/users/alex-codefresh/followers","following_url":"https://api.github.com/users/alex-codefresh/following{/other_user}","gists_url":"https://api.github.com/users/alex-codefresh/gists{/gist_id}","starred_url":"https://api.github.com/users/alex-codefresh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex-codefresh/subscriptions","organizations_url":"https://api.github.com/users/alex-codefresh/orgs","repos_url":"https://api.github.com/users/alex-codefresh/repos","events_url":"https://api.github.com/users/alex-codefresh/events{/privacy}","received_events_url":"https://api.github.com/users/alex-codefresh/received_events","type":"User","site_admin":false},"labels":[{"id":345371703,"url":"https://api.github.com/repos/docker/compose/labels/group/windows-server","name":"group/windows-server","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-03T15:11:56Z","updated_at":"2018-05-04T07:09:03Z","closed_at":null,"author_association":"NONE","body":"## Description of the issue\r\n\r\nI need to run docker-compose **from inside a Windows container** and make it connect to the **docker daemon on the host** which runs this container via a **named pipe mount** (*like docker run -v //./pipe/docker_engine://./pipe/docker_engine ...*). \r\n\r\nBut the problem is that docker-compose uses the WinAPI call **[WaitNamedPipe](https://msdn.microsoft.com/en-us/library/aa365800.aspx)** in the module `npipesocket.py`, which seems is not supposed to work from inside a container and throws the error:\r\n\r\n`pywintypes.error: (2, 'WaitNamedPipe', 'The system cannot find the file specified.')`\r\n\r\nI have carefully checked that the named pipe is mounted correctly and available via the expected name. And I am able to work with the docker daemon on the same mounted named pipe using the docker-cli from inside the container, which indicates the issue is specific to docker-compose.\r\n\r\n## Context information (for bug reports)\r\n\r\n\r\n**Output of \"docker-compose version\"**\r\n```\r\ndocker-compose version 1.21.2, build a1334711\r\ndocker-py version: 3.3.0\r\nCPython version: 3.6.4\r\nOpenSSL version: OpenSSL 1.0.2k  26 Jan 2017\r\n```\r\n\r\n**Output of \"docker version\"**\r\n```\r\nClient:\r\n Version:      17.10.0-ee-preview-3\r\n API version:  1.33\r\n Go version:   go1.8.4\r\n Git commit:   1649af8\r\n Built:        Fri Oct  6 17:52:28 2017\r\n OS/Arch:      windows/amd64\r\n\r\nServer:\r\n Version:      17.10.0-ee-preview-3\r\n API version:  1.34 (minimum version 1.24)\r\n Go version:   go1.8.4\r\n Git commit:   b8571fd\r\n Built:        Fri Oct  6 18:01:48 2017\r\n OS/Arch:      windows/amd64\r\n Experimental: false\r\n```\r\n**Output of \"docker-compose config\"**\r\n```\r\n{\r\n        \"auths\": {\r\n                \"https://index.docker.io/v1/\": {\r\n                        \"auth\": \"*\"\r\n                },\r\n        },\r\n        \"HttpHeaders\": {\r\n                \"User-Agent\": \"Docker-Client/17.10.0-ee-preview-3 (windows)\"\r\n        }\r\n}\r\n```\r\n\r\n## Steps to reproduce the issue\r\n\r\n1. Install docker-ee (17.10.0-ee-preview-3) on a Windows Server (version 1709) host\r\n2. Build an image using the following Dockerfile:\r\n```\r\nFROM microsoft/windowsservercore:1709\r\n\r\nSHELL [\"powershell\", \"-Command\"]\r\n\r\nRUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \\\r\n    Invoke-WebRequest \"https://github.com/docker/compose/releases/download/1.21.2/docker-compose-Windows-x86_64.exe\" \\\r\n    -UseBasicParsing -OutFile 'C:\\Program Files\\docker-compose.exe'\r\n\r\nENTRYPOINT [\"C:/Program Files/docker-compose.exe\"]\r\n```\r\n\r\n3. Copy any docker-compose.yaml into an arbitrary folder on the host (for example C:\\temp)\r\n4. Run the built image with the following command: \r\n\r\n\r\n`docker run --rm -v C:/temp:C:/temp -v //./pipe/docker_engine://./pipe/docker_engine built/imagename --verbose -f C:\\temp\\docker-compose.yaml up`\r\n\r\n\r\n### Observed result\r\n\r\n`docker-compose` throws the error on any command (except for `docker-compose  version`):\r\n\r\n`pywintypes.error: (2, 'WaitNamedPipe', 'The system cannot find the file specified.')`\r\n\r\n\r\n### Expected result\r\n\r\n`docker-compose` is able to work with the docker daemon on the host via a named pipe mounted as a volume\r\n\r\n### Stacktrace / full error message\r\n\r\n```\r\ncompose.config.config.find: Using configuration files: .\\cf-generated-docker-compose.yaml\r\ndocker.utils.config.find_config_file: Trying paths: ['C:\\\\Users\\\\ContainerAdministrator\\\\.docker\\\\config.json', 'C:\\\\Users\\\\ContainerAdministrator\\\\.dockercfg']\r\ndocker.utils.config.find_config_file: Found file at path: C:\\Users\\ContainerAdministrator\\.docker\\config.json\r\ndocker.auth.load_config: Found 'auths' section\r\ndocker.auth.parse_auth: Found entry (registry='https://index.docker.io/v1/', username='*')\r\nTraceback (most recent call last):\r\n  File \"docker-compose\", line 6, in <module>\r\n  File \"compose\\cli\\main.py\", line 71, in main\r\n  File \"compose\\cli\\main.py\", line 124, in perform_command\r\n  File \"compose\\cli\\command.py\", line 41, in project_from_options\r\n  File \"compose\\cli\\command.py\", line 121, in get_project\r\n  File \"compose\\cli\\command.py\", line 95, in get_client\r\n  File \"site-packages\\docker\\api\\daemon.py\", line 179, in version\r\n  File \"site-packages\\docker\\utils\\decorators.py\", line 46, in inner\r\n  File \"site-packages\\docker\\api\\client.py\", line 194, in _get\r\n  File \"site-packages\\requests\\sessions.py\", line 521, in get\r\n  File \"site-packages\\requests\\sessions.py\", line 508, in request\r\n  File \"site-packages\\requests\\sessions.py\", line 618, in send\r\n  File \"site-packages\\requests\\adapters.py\", line 440, in send\r\n  File \"site-packages\\urllib3\\connectionpool.py\", line 600, in urlopen\r\n  File \"site-packages\\urllib3\\connectionpool.py\", line 356, in _make_request\r\n  File \"http\\client.py\", line 1239, in request\r\n  File \"http\\client.py\", line 1285, in _send_request\r\n  File \"http\\client.py\", line 1234, in endheaders\r\n  File \"http\\client.py\", line 1026, in _send_output\r\n  File \"http\\client.py\", line 964, in send\r\n  File \"site-packages\\docker\\transport\\npipeconn.py\", line 31, in connect\r\n  File \"site-packages\\docker\\transport\\npipesocket.py\", line 22, in wrapped\r\n  File \"site-packages\\docker\\transport\\npipesocket.py\", line 50, in connect\r\npywintypes.error: (2, 'WaitNamedPipe', 'The system cannot find the file specified.')\r\n[16140] Failed to execute script docker-compose\r\n```"},"comment":{"url":"https://api.github.com/repos/docker/compose/issues/comments/386521224","html_url":"https://github.com/docker/compose/issues/5934#issuecomment-386521224","issue_url":"https://api.github.com/repos/docker/compose/issues/5934","id":386521224,"user":{"login":"alex-codefresh","id":33512662,"avatar_url":"https://avatars0.githubusercontent.com/u/33512662?v=4","gravatar_id":"","url":"https://api.github.com/users/alex-codefresh","html_url":"https://github.com/alex-codefresh","followers_url":"https://api.github.com/users/alex-codefresh/followers","following_url":"https://api.github.com/users/alex-codefresh/following{/other_user}","gists_url":"https://api.github.com/users/alex-codefresh/gists{/gist_id}","starred_url":"https://api.github.com/users/alex-codefresh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alex-codefresh/subscriptions","organizations_url":"https://api.github.com/users/alex-codefresh/orgs","repos_url":"https://api.github.com/users/alex-codefresh/repos","events_url":"https://api.github.com/users/alex-codefresh/events{/privacy}","received_events_url":"https://api.github.com/users/alex-codefresh/received_events","type":"User","site_admin":false},"created_at":"2018-05-04T07:09:03Z","updated_at":"2018-05-04T07:09:03Z","author_association":"NONE","body":"Is there any chance that **you avoid using this API call** in favor of some other way of communication with the mounted named pipe? Given that **docker-cli is able to do it** in the described above conditions, I am sure there is another way."}}
{"actor":{"display_login":"alex-codefresh"}}