-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compose on macOS, docker host on windows #5371
Comments
Unfortunately we don't currently support this use-case (UNIX host to Windows containers), but I'm aware this is an issue. The changes I'm making in #5363 may help. |
I tried #5363 with this yml version: "3.2"
services:
test:
image: microsoft/windowsservercore
volumes:
- C:\\Users\\stefan\\.ssh:C:\\ssh
networks:
default:
external:
name: nat but it shows this error:
Then I tried slashes version: "3.2"
services:
test:
image: microsoft/windowsservercore
volumes:
- C:/Users/stefan/.ssh:C:/ssh
networks:
default:
external:
name: nat but another error occurs with named volumes
Removing drive letter also does not help: version: "3.2"
services:
test:
image: microsoft/windowsservercore
volumes:
- /Users/stefan/.ssh:/ssh
networks:
default:
external:
name: nat
|
@StefanScherer Yeah, that PR is heavy WIP still, absolutely not in a usable state. I'll ping you once it gets there :) |
@shin- Thanks, that would be fine. Just drafted a quick FROM python:2.7.14-windowsservercore
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ENV GIT_VERSION 2.14.2
ENV GIT_DOWNLOAD_URL https://github.com/git-for-windows/git/releases/download/v${GIT_VERSION}.windows.1/MinGit-${GIT_VERSION}-64-bit.zip
ENV GIT_SHA256 9638733b8d749c43d59c34a714d582b2352356ee7d13c4acf919c18f307387f5
RUN Invoke-WebRequest -UseBasicParsing $env:GIT_DOWNLOAD_URL -OutFile git.zip; \
if ((Get-FileHash git.zip -Algorithm sha256).Hash -ne $env:GIT_SHA256) {exit 1} ; \
Expand-Archive git.zip -DestinationPath C:\git; \
Remove-Item git.zip; \
Write-Host 'Updating PATH ...'; \
$env:PATH = 'C:\git\cmd;C:\git\mingw64\bin;C:\git\usr\bin;' + $env:PATH; \
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\' -Name Path -Value $env:PATH
COPY . /code
WORKDIR /code
RUN pip install tox==2.1.1 virtualenv==13.1.2
RUN .\\script\\build\\windows.ps1 But have to copy the binary from the image back to my Mac with these commands so I can use it in a Win2016 VM.
|
@StefanScherer PR should be more stable now - can you give it another shot? Thank you! |
@shin- Yeah, will fetch the PR again and build compose again. Would be much easier if we could use CircleCI for this repo to have artifacts (all cross compiled compose bins) for each PR/Git commit like we have in docker/cli repo. That saved me a lot of time to test docker manifest command 😅 |
Out of interest, why can't CircleCI be used for this repo? |
@lox @StefanScherer Is this still an issue with 1.18.0? |
Yup, I believe so. I will double check. |
@shin- With 1.18.0 I see this error
version: "3.2"
services:
test:
image: microsoft/windowsservercore
volumes:
- C:\\Users\\stefan\\.ssh:C:\\ssh
networks:
default:
external:
name: nat
|
@StefanScherer Ok, I'll take another look at it then. Any luck with the extended syntax? i.e. volumes:
- type: bind
source: C:\\Users\\stefan\\.ssh
target: C:\\ssh |
@shin- With the extended syntax I get
Then I tried
|
Thanks @shin- for the tip using single backslashes. It works with docker-compose 1.18.0 and single backslashes and the extended syntax: 🎉 version: "3.2"
services:
test:
image: microsoft/windowsservercore
volumes:
- type: bind
source: C:\Users\stefan\.ssh
target: C:\ssh
networks:
default:
external:
name: nat
|
Nice one. Whilst
|
But of course Docker on Windows uses symlinks for it's binds. 😭 |
I've been working with https://github.com/StefanScherer/windows-docker-machine to be able to run windows docker containers from macOS. I'm having trouble mapping paths through. This works:
When I try and translate that to docker-compose.yml, e.g:
And I get this error:
ERROR: Volume C:\\Users\\lachlan\\.ssh:C:\\ssh has incorrect format, should be external:internal[:mode]
Any ideas?
I'm running:
docker version:
docker-info:
The text was updated successfully, but these errors were encountered: