Boris Eetgerink

March 25, 2023

Using dotnet watch from a Docker container

Run this command from the directory of the web application. I don't recommend it as daily development workflow, as the container adds quite some performance overhead, but it's great if you need to check how something works when running in a container.

docker run -it --rm
  --mount type=bind,src="$(pwd)",target=/app
  -p 5000:5000
  -e "some_token=abc42"
  dotnet watch run --project /app --urls

The application is now running on http://localhost:5000/.

About Boris Eetgerink

Hey, this is my C# .NET blog. I don't have a comments system, but you can contact me at boriseetgerink at hey dot com.