Docker image is updated gradually in production environment

Let's say we have a docker image instance running in a production environment. Image contains Linux OS and application jar file. As part of the hotfix release, some changes in some applications are applied in the jar application. Can these changes be updated incrementally in production or do we need to replace the entire image? If we can create an increment and update it, then what are the commands to perform these operations.

In a large production environment where there are a huge number of docker instances and a patch is required, the whole image will move overhead rather than increment / delta.

+3


source to share


2 answers


I would not use the strategy of changing and committing docker images in production environments. Just because in the end you can't exactly reproduce the way you made changes to the images. You can only see the differences.

I would build images in a build environment (like Jenkins) using Dockerfile

s. Especially when you mentioned JAR files - when you use maven to build your Java application, you can also easily create a docker image in the same one using the docker-maven-plugin . This way, you can always reproduce the image in your build environment.



Then when it comes to the deployment phase where you have to deploy to dozens of servers, you wouldn't do it manually, of course. You would automate this step.

+2


source


According to the FAQ, you can incrementally update images similar to git pull.

Versioning. Docker includes git-like capabilities for keeping track of sequential versions of a container, checking for differences between versions, committing new versions, rolling back, etc. The history also includes how the container was built and by whom, so you get full traceability from the production server right down to the developer. Docker also implements incremental downloads and uploads similar to git pull, so new versions of the container can be pushed in by sending a diff.



Regarding this, I would think the docker pull way would be like it skips the already loaded levels and only gets the new ones.

0


source







All Articles