Docker Continuous Deployment Workflow

I plan to set up a jenkins-based docker-based workflow at the end. My idea is to automatically create (according to Jenkins) the docker image for each green assembly, and then expand this image with either Jenkins or the “hand” (I'm not sure if I want to automatically start each green assembly).

How easy it is to create a new image. My question is about deployment itself. What is the best practice for “rebooting” or “restarting” a working docker container? Suppose the image has been changed for the container, how can I gracefully reload it when your service is running? Do I need to do a traditional dance with several running containers and load balancing, or is there a docker way?

+8
linux docker continuous-integration continuous-deployment
source share
2 answers

Suppose the image has changed for the container, how to gracefully reload it when you have a service running inside?

You do not want this.

Docker is a simple system for managing applications and their dependencies. It is simple and durable, because all the dependencies of the application are embedded in it. If your application runs today on your laptop, it will work tomorrow on your server. This is because we captured 100% of the "inputs" for your application.

As soon as you introduce concepts such as “update” and “reboot”, your application may (accidentally) save state internally. This means that tomorrow can do otherwise than today (after restarting and updating 100 times).

It's better to use a load balancer (or similar) to switch between your versions than trying to drop the Docker philosophy.

+6
source share

The Docker machine itself must always be unchanged, as you must replace it for a new deployment. Saving state inside a Docker container will not work if you want to send new releases often that you created on your CI.

Docker supports volumes that allow you to write files that are persistent to any folder on the host. When you then upgrade the Docker container, you use the same volume to access the same files written by the old container:

https://docs.docker.com/userguide/dockervolumes/

+1
source share

All Articles