-
Notifications
You must be signed in to change notification settings - Fork 5.6k
05. Running locally on a Windows Container from Visual Studio
To deploy the eShopOnWeb sample to a local Windows Docker container from Visual Studio, follow these step-by-step instructions:
-
Clone or download the eShopOnWeb sample to a folder on your local machine.
-
Ensure the computer on which you're running has Windows containers enabled. You can read how perform the one-time setup on the Docker Blog
-
Right click on the
Web
project in Visual Studio and select theAdd
menu thenDocker Support
- Select
Windows
and 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.yml
from thedocker-compose
project and change the line that reads80
to read5106
. This is the port eShopOnWeb is configured to run on. (See theProgram.cs
file for details)
-
Press
F5
to run the project or selectDebug
>Start Debugging
from the menu. -
Your default browser will start on a random port of the IP address which is forwarded to the docker container.
You may encounter an error if your Docker for Windows is configured to run Linux containers. This setting may be changed by right clicking on the tray icon and selecting Switch to Windows containers
- Getting Started for Beginners (with video)
-
Walkthroughs
- Deploying to Azure App Service from Visual Studio
- Deploying to Azure App Service from Azure Portal
- Deploying to Azure App Service from Visual Studio for Mac
- Running as a Linux Container locally in Visual Studio
- Deploying as a Linux Container into Azure App Service
- Running in a Windows Container locally in Visual Studio
- Running as a Linux Container locally in Visual Studio for Mac
- Deploying as a Windows Container into a Windows Container host in Azure
- Working with the Project and Adding New Features using Visual Studio for Mac