Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automatically deploy and run docker images on server?

Tags:

docker

I'm trying to setup the deployment of docker images to Linux server (Debian 10). I looked over the internet to find an easy solution to deploy images from docker repository onto a server automatically. I know that Docker Hub has webhooks. Also, there is an option to use Kubernetes, but it seems to be a bit too much for a simple application running on one server. What I am looking for is a way for server to detect that docker image has been updated, so that it downloads it and runs the newest version.

Currently, I have setup automatic build of docker images on Azure DevOps that are pushed to private repository on Docker Hub (I will most likely move to privately hosted Nexus repository). I am looking for suggestions on how to do it with relatively low complexity (e.g. should I use docker-compose for it or some sort of bash script on a server).

The closest thing to what I am looking for is this solution: How to auto deploy Docker Image on own server with GitLab? I would like to know if this is the recommended way to do or are there any other, possibly easier ways to approach it.

like image 522
Jan Jaworski Avatar asked Sep 07 '25 10:09

Jan Jaworski


1 Answers

I found this project that looks good as a solution for my case.

https://containrrr.github.io/watchtower/

like image 77
Jan Jaworski Avatar answered Sep 10 '25 19:09

Jan Jaworski