How to deploy a docker container to an Ubuntu server instance from Azure DevOps release pipeline?

Viewed 610

I added a Docker task in the build pipeline to build and push the image I created to Docker Hub.

Then, I added two more tasks (copy files and publish build artifacts) so that the files are available to the release pipelines.

Now, I want to know how to run this image (docker run), so that the container gets deployed to my Ubuntu server instance (209.97.179.151).

What tasks should I add in the release pipeline to deploy the image to the server 209.97.179.151?

enter image description here

1 Answers

You can use the ssh task to ssh to the remote server (209.97.179.151).

Use docker stop, docker pull, and docker run to update your image.

You can set and use the $(tag) variable to set the tag of the image.

variables:
  tag: latest
Related