0

I need some help with docker configuration on TFS. I've got some experience but not much. I have configured classic CI for .NET projects few times where these steps were used:

-get sources
-run tests
-build
-copy files to server

Recently I've started to use Docker and I would like to automate this process, because now I have to copy files manually to remote machine and then run these commands:

dotnet publish --configuration=Release -o pub
docker build . -t netcore-rest
docker run -e Version=1.1 -p 9000:80 netcore-rest

I saw few tutorials for VSTS, but I'd like to configure it for classic TFS. I don't have docker hub. What interesting me is:

-how to kill/remove currently running container
-build new one from copied files
-run a new container

Thank you

PS. I have already installed docker on my agent machine, so it's able to build an image.

tylkonachwile
  • 2,025
  • 4
  • 16
  • 28
  • 1
    There should be minimal differences in how you approach it for on-prem TFS vs VSTS, assuming you have a modern version of TFS. What version are you using? – Daniel Mann Sep 07 '18 at 15:04
  • Version 16.131.27701.1 – tylkonachwile Sep 07 '18 at 15:07
  • 1
    That's TFS 2018 Update 2. Everything should be largely the same as it is in VSTS. – Daniel Mann Sep 07 '18 at 15:12
  • 1
    Install the [Docker Integration](https://marketplace.visualstudio.com/items?itemName=ms-vscs-rm.docker) extension, then you can reference [Build, push and run Docker images with Visual Studio Team Services](https://blog.jcorioland.io/archives/2016/08/19/build-push-and-run-docker-images-with-visual-studio-team-services.html). This thread may helps : https://stackoverflow.com/questions/45614692/is-it-possible-to-create-a-docker-container-from-tfs-and-deploy-a-release-build – Andy Li-MSFT Sep 09 '18 at 07:19

0 Answers0