Running Locally on a Linux Container from Visual Studio for Mac
To deploy the eShopOnWeb sample to a local Linux Docker container, from Visual Studio for Mac, follow these step-by-step instructions:
-
Clone or download the eShopOnWeb sample to a folder on your local machine.
-
Ensure that you have installed a recent version of Docker for Mac
Note : (steps 3 and 4 have been done already for eShopOnWeb, but are included so you see how you would add support to your own projects)
-
Right click on the
Webproject in VS for Mac and select theAddmenu thenDocker Support. -
Select
Linuxand click onOK. This will create a new project in your solution calleddocker-compose. This project contains the settings for deploying to Docker. -
Open the
docker-compose.override.ymlfrom thedocker-composeproject and change the line that reads80to read5106. This is the port eShopOnWeb is configured to run on. (See theProgram.csfile for details) -
Run the project with
Run>Start Debuggingfrom the menu. -
Your default browser will start on a random port on
localhostwhich is forwarded to the docker container.
Troubleshooting
The first time you run the application you may need to add a folder sharing path to Docker. Make sure you add the /usr/local/share/dotnet/sdk/NuGetFallbackFolder folder to Docker’s file sharing options as detailed here.