Comments (8)
My guess is that you are using an out of date version of the NuGet. In my testing version 1.10.11+ honored DockerfileRunArguments
from the launch profile.
from dockertools.
@NCarlsonMSFT I am using version 1.19.5 of the package which appears to be the latest. The functionality works fine if I set set the DockerfileRunArguments via an msbuild property but not from launch settings.
from dockertools.
@groogiam can you give more details on what you are seeing? I tested by setting an environment variable using the run arguments and it was available on each run. What are you not seeing in the subsequent runs?
from dockertools.
I am attempting to pass these arguments --network=another-compose-network -v /var/run/docker.sock:/var/run/docker.sock
The project that is not working works as an agent for a larger compose project. In product the main services would spin up this project in a container. In order to debug this agent process I first start visual studio and run the other compose project. Then I run this project in debug mode. Depending on what was selected as the Startup Project in Visual studio when I open it I get different behavior.
If the agent project is select the run arguments are executed. However, if I kill the container and rerun the project in visual studio the arguments are not added.
If the other compose project was the default startup project then that is warmed up and if I switch to the agent project the container is not warmed up. When I run / debug the container is run but the arguments are not present.
Again this behavior only seems to manifest when using launchSettings. Everything appears to work correctly with the msbuild properties added directly to the csproj.
from dockertools.
Sorry for the delay on responding, I was out with Flu.
I tested again passing the --network in my single project to connect to a service in a running compose project and was able to do so even after rebuilding. My repro steps:
- Create a new API project
- Add compose support
- Create a new project
- Add just Container support (no compose)
- Add
DockerfileRunArguments
with the value--network=another-compose-network -v /var/run/docker.sock:/var/run/docker.sock
- Clean to remove all containers
- Compose up on the compose project
- F5 on the single project
My single container project was able to connect and looking at the build log I could see the docker run command included passing my DockerfileRunArguments
. Can you check the output window's build pane and see what your docker run command looks like?
from dockertools.
I had checked the docker command prior to submitting the issue and it did not include the runfile arguments. I'll run through the entire procedure again hopefully tomorrow and send you the output.
In your procedure are you running the 'Compose Up' step manually via the command line or is Visual Studio doing that as part of the container warmup? In my testing Visual Studio takes care of this at start or by debugging / running the compose project. I am unable to remove the compose project via the docker gui while visual studio is running also. Not sure these are material but there does appear to be some small differences in procedure here.
Thanks for your help.
from dockertools.
@NCarlsonMSFT I went back and retested my workflow and things now appear to be working correctly. I'm not sure what I was doing differently when I reported this but I can no longer reproduce the behavior. Thanks again for taking the time to setup a repro and validate it is working correctly. Sorry for wasting your time trying to reproduce this.
from dockertools.
@groogiam NP, glad it's working for you now!
from dockertools.
Related Issues (20)
- Docker Compose project doest not support secrets in `docker-compose.yml` HOT 3
- Visual Studio 2022 and Docker project debugging issues HOT 6
- Un-escaped JSON in `AzureServiceAuth\tokenprovider.json` HOT 3
- User secrets not available for isolated function app HOT 3
- Write access to /home required for functions tooling to create /home/.azurefunctions folder HOT 5
- ENC1002 Cannot apply changes. Unexpected error: 'An item with the same key has already been added. Key: 420' HOT 8
- Not found application or .NET SDKs issue when running docker-compose HOT 1
- Windows container .NET 8 RC: MSB3052: The parameter to the compiler is invalid, '/define:$BUILD_CONFIGURATION' HOT 1
- VisualStudioCredential is supported in .NET Framework container? HOT 1
- Problem Installing Docker HOT 1
- Program does not contain a static 'Main' method suitable for an entry point docker HOT 1
- Allow Running Docker Compose inside of WSL2 with VS2022 HOT 1
- The "Configuration" parameter is not supported by the "WaitForWarmupCompletion" task HOT 4
- Relative paths in generated dockerfile appear to be incorrect HOT 4
- Unable to run jammy-chiseled from Visual Studio HOT 25
- Check whether the file has been patched update HOT 5
- Unable to push an image to a repository with multiple image tags HOT 4
- DOCKER_CONVERT_WINDOWS_PATHS without Docker Desktop HOT 1
- Docker Compose Project Fails to Start with Docker Desktop 4.27 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dockertools.