Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying docker container to production server from Visual Studio 2017 RTM

Tags:

I'm completely lost on this.

I have installed Docker on my Windows 10 machine. It is running. I shared out my C drive in Settings. I then created an ASP.NET Core 1.1 project with Docker support in Visual Studio 2017 RTM. Once the project was created, I hit F5 to run it. It built the container, deployed it to my local Docker installation, and launched my web browser. There is my web site running! Yay!

I'd now like to take that container, and deploy it to Docker running on a Linux machine, but there is no Publish option in Visual Studio for the docker-compose project. I can Publish the web project, but only to Azure or IIS.

I have looked all over for an answer to this, but all I can find is how to deploy locally, and I've already figured that out.

like image 324
TheCodeFiend Avatar asked Mar 08 '17 07:03

TheCodeFiend


People also ask

How do I deploy a Visual Studio project to Docker?

Right-click on the project node and choose Publish.... A screen showing deployment options appears. Choose Docker Container Registry, and then choose Docker Hub. Enter your Docker credentials.

How do I add a docker container in Visual Studio?

To attach to a running process in a Windows Docker container: In Visual Studio, select Debug > Attach to Process (or CTRL+ALT+P) to open the Attach to Process dialog box. Set the Connection type to Docker (Windows Container). Select Find... to set the Connection target using the Select Docker Container dialog box.

How do I add Docker support to an existing project in Visual Studio?

Existing app Open the project in Visual Studio, and choose one of the following options: Select Docker Support from the Project menu. Right-click the project in Solution Explorer and select Add > Docker Support.

Does Visual Studio require Docker desktop?

Visual Studio Container Tools requires Docker to be running before building, debugging or running a containerized project. Please review the attached image. If i build and run the project using docker cli, it's working.


1 Answers

There is currently no publish option from within the tooling that will push an image to a registry, but you should be able to do this fairly easily. I would recommend to build the "release" configuration of the docker-compose project which should build an image locally. You can then use the docker command line to push that image to Docker Hub or Azure Container Registry, in which you can then pull it down to the Linux docker machine.

like image 102
Devin Breshears Avatar answered Oct 12 '22 23:10

Devin Breshears