Start the SDK--container interactively, mounting the current directory as /app in the container $ docker run --rm -it -v $(pwd):/app mcr.microsoft.com/dotnet/sdk:5.0 Change to folder ./app which contains the ./src folder (/app/src) # cd /app Start the build using /app/src as source folder and writing to /app/out # dotnet publish -c Release -o out src That's it, exit # exit