Docker Community Forums

Share and learn in the Docker community.

Use docker to build visual studio project

Hi
I have been tasked with using docker to build a visual studio solution from team city
The build has to take place on a windows server 2019 machine
I have installed docker on the target machine and understand that I need to write a Dockerfile to supply to Team City.
My problem is that I don’t know what goes in the Dockerfile

Please can someone guide me through this.

Thanks

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.

I dont see those options and I need to build from with team city

the process should start in Visual Studio, with the Docker web application support the IDE is in charge of creating the Dockerfile. You can then push the project to GIT, and this should be taken by Team city.
I did it this way but with Jenkins.

Don’t pay attention to lewis95, it seems to be some sort of bot.

You should e able to create a simple Dockerfile and use it in your local machine. There are a plethora of docker quick start guides out there that explains what needs to be implemented within a Dockerfile starting with the Docker official documentation: https://docs.docker.com/get-started/

I suggest you take it one step further and use docker-compose which will allow you to override settings when your application is deployed: https://docs.docker.com/compose/extends/