Skip to content
This repository has been archived by the owner on Apr 11, 2020. It is now read-only.

Docker in launchSettings.json #1074

Open
AceHack opened this issue Jun 2, 2018 · 8 comments
Open

Docker in launchSettings.json #1074

AceHack opened this issue Jun 2, 2018 · 8 comments

Comments

@AceHack
Copy link

AceHack commented Jun 2, 2018

Please give documentation on how to add volume mounts. I need to add a custom volume mount into my image.

@barrytang
Copy link

To report new issues, use the Report a Problem tool. The GitHub Issue Tracker for the aspnet/Tooling repo is now deprecated in favor of the Report a Problem tool.

If you encounter a problem with Visual Studio, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks. See here for more details.

@AceHack
Copy link
Author

AceHack commented Jun 2, 2018

@barrytang This is not an issue but a question. Report a Problem is not for questions, where do I go for questions?

@barrytang
Copy link

I apologize. I reopened the issue now. I will see if I can find someone that I can add here to help.

@barrytang barrytang reopened this Jun 4, 2018
@philliphoff
Copy link

@AceHack I'll try to help as best I can. Can you provide a little more context? Which set/version of (VS) tools are you using, what kind of a project(s) is it, etc.?

@AceHack
Copy link
Author

AceHack commented Jun 4, 2018

Ive expanded on the question a lot on stackoverflow since this was closed.

https://stackoverflow.com/questions/50659392/asp-net-core-custom-docker-volume-mount-in-visual-studio

@philliphoff
Copy link

Ah, I see now.

You can add arbitrary arguments to the Docker build and Docker run commands via the DockerfileBuildArguments and DockerfileRunArguments MSBuild properties, respectively. For example:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <DockerfileRunArguments>-v "C:\HostFolder:/ContainerFolder:ro"</DockerfileRunArguments>
  </PropertyGroup>
</Project>

If those arguments need to vary from debug session to debug session, you can add conditions to the properties such that one applies to each selectable build configuration.

@nphmuller
Copy link

@philliphoff Those arguments look exactly like what I need. A couple of questions:

  • Are they documented somewhere? Can't find any result when I Google them (except for this page and the StackOverflow question.
  • How exactly do they work? Does it detect that I'm launching docker.exe in launchsettings.json? Does it detect the DOTNET_RUNNING_IN_CONTAINER environment variable? Does it only work in a Docker project?

@nphmuller
Copy link

DockerComposeProjectPath seems to be another one.

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

No branches or pull requests

4 participants