P
P
puglsey2021-06-27 04:23:30
Node.js
puglsey, 2021-06-27 04:23:30

Automate container rebuilding after installing a package in a project. Is it possible to?

Good afternoon!

If you develop directly in the container, then if I understand correctly, all changes are best made to the dockerfile and docker-compose.yml, but after that you need to rebuild the container. As a result, if you need to install some kind of dependency, then you have to rebuild everything from scratch every time. Is it possible to somehow automate or simplify (or maybe avoid) this process? If so, how?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
�
âš¡ Kotobotov âš¡, 2021-06-27
@angrySCV

Well, there is such a docker commit command - which allows you to save changes in the container. but I think it's still worth saving all the steps necessary for a new build of the image to the docker file (just not always rebuilding it).
and in order to automate the assembly, they usually build CI / CD pipelines, tying them on changes in the repository. That is, in its repository, additional steps are described for building the container, which are triggered every time changes occur in the repository (well, for example, changes in the docker file or some changes in the project code).
PS The
assembly, of course, starts from scratch, but due to the fact that each instruction in the docker file is a separate layer that is cached, the process can be accelerated quite well.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question