Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

03a. Running Locally on a Linux Container from Visual Studio

Steve Smith edited this page Sep 12, 2019 · 1 revision

To deploy the eShopOnWeb sample to a local Linux Docker container, from Visual Studio, follow these step-by-step instructions:

  1. Clone or download the eShopOnWeb sample to a folder on your local machine.

  2. Ensure that you have installed a recent version of Docker for Windows

  3. Right click on the Web project in Visual Studio and select the Add menu then Docker Support

Add docker support by clicking Add > Docker Support.

  1. Select Linux and click on OK. This will create a new project in your solution called docker-compose. This project contains the settings for deploying to Docker.

Select Linux in the Docker Support Options dialog

  1. Open the docker-compose.override.yml from the docker-compose project and change the line that reads 80 to read 5106. This is the port eShopOnWeb is configured to run on. (See the Program.cs file for details)

Update the port override.

  1. Press F5 to run the project or select Debug > Start Debugging from the menu.

  2. Your default browser will start on a random port on localhost which is forwarded to the docker container.

The eShopOnline web application running in a Linux container

Troubleshooting

You may encounter an error if your Docker for Windows is configured to run Windows containers. This setting change be changed by right clicking on the tray icon and selecting Switch to Linux containers

Change the sort of containers docker uses by default.

Clone this wiki locally