Skip to content
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

Support remote Docker hosts (was: how add -H in docker build in vs) #151

Open
gitlsl opened this issue Sep 27, 2018 · 4 comments
Open

Support remote Docker hosts (was: how add -H in docker build in vs) #151

gitlsl opened this issue Sep 27, 2018 · 4 comments

Comments

@gitlsl
Copy link

gitlsl commented Sep 27, 2018

default build will get error in vs2017
docker build -f "E:\vsproject\TestDemo\WebApplication1\Dockerfile" -t webapplication1:dev --target base "E:\vsproject\TestDemo"

next is I need
docker -H tcp://192.168.34.211:2375 build -f "E:\vsproject\TestDemo\WebApplication1\Dockerfile" -t webapplication1:dev --target base "E:\vsproject\TestDemo"

but how can I add this?
thanks a lot

@gitlsl gitlsl changed the title how add -H in docker build how add -H in docker build in vs Sep 27, 2018
@gitlsl
Copy link
Author

gitlsl commented Sep 27, 2018

DOCKER_HOST add this to PATH is ok
1>docker run -dt -v "C:\Users\Administrator\vsdbg\vs2017u5:/remote_debugger:rw" -v "E:\vsproject\TestDemo\WebApplication1:/app" -v "C:\Users\Administrator\.nuget\packages\:/root/.nuget/fallbackpackages2" -v "C:\Program Files\dotnet\sdk\NuGetFallbackFolder:/root/.nuget/fallbackpackages" -e "DOTNET_USE_POLLING_FILE_WATCHER=1" -e "ASPNETCORE_ENVIRONMENT=Development" -e "NUGET_PACKAGES=/root/.nuget/fallbackpackages2" -e "NUGET_FALLBACK_PACKAGES=/root/.nuget/fallbackpackages;/root/.nuget/fallbackpackages2" -P --entrypoint tail webapplication1:dev -f /dev/null
1>docker: Error response from daemon: Mount denied:

@bwateratmsft
Copy link
Contributor

Hey @gitlsl ,

Using a remote machine as the docker host is not supported by default as volume mapping is much more complicated. Volume mapping is necessary to use Debug mode in all cases, and in Release mode as well if you're using ASP.NET Core 2.1 + HTTPS. There may be a way to enable volume mapping (perhaps using a network drive?) but we have not investigated or tested this.

@gitlsl
Copy link
Author

gitlsl commented Sep 28, 2018

@bwateratmsft OK , wish you can add this feature

@bwateratmsft bwateratmsft changed the title how add -H in docker build in vs Support remote Docker hosts (was: how add -H in docker build in vs) Sep 28, 2018
@SpoonsJTD
Copy link

I have worked around this by removing the Docker for Windows install dir from the env path, and adding a docker.bat into the env path that calls docker.exe directly using the -H option and passing all other options to the exe. As bwateratmsft explained, it does break debugging, but I switch the debugging over to use IIS Express for dev testing, then do full testing after deploying the image to a staging docker environment by 'Publish'ing it to a custom registry running on the staging environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants