Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Remote Testing - Add additional docker run arguments

I'm using the remote testing feature from Visual Studio to execute my unit tests on a Linux container.

For this, I have the following Dockerfile.test

FROM mcr.microsoft.com/dotnet/sdk:6.0
RUN mkdir /usr/local/temp

RUN wget https://aka.ms/getvsdbgsh && \
    sh getvsdbgsh -v latest  -l /vsdbg

And the following testenvironments.json

{
    "version": "1",
    "environments": [
        {
            "name": "GitServiceUnix",
            "type": "docker",
            "dockerFile": "Dockerfile.test"
        }
    ]
}

Working fine as it should.

Now I came to the point that I have to mount a volume into the testing container.

  1. Is there any way to add additional docker run arguments like in the Debug Properties?
  2. Is the remote testing also working with a docker-compose file?
  3. Can I build & run the container myself and tell Visual Studio to execute the remote test on this container?
like image 490
JoJ Avatar asked Dec 10 '25 11:12

JoJ


1 Answers

  1. Based on https://learn.microsoft.com/en-us/visualstudio/test/remote-testing?view=vs-2022#local-container-connections there is not a documented way to add a volume
  2. You can start a container and then connect using SSH: https://learn.microsoft.com/en-us/visualstudio/test/remote-testing?view=vs-2022#ssh-connections.
like image 84
Nathan Carlson - MSFT Avatar answered Dec 13 '25 09:12

Nathan Carlson - MSFT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!