I am making my own Dockerfiles for several services, and I noticed that most of them have an apt install
command in their RUN
s, thus everytime I reinstall the image, it gets upgraded to the latest.
I am afraid sooner or later some programs could fail with this method, as I configure them with pre-made configuration files and then mount them into the containers, with newer versions some preferences might became deprecated, obsolete or just make containers and their programs stop servicing.
I thought about specifying the package version in the apt like apt install apache2=x.y.ubuntu-z
and so on, but the Ubuntu repos only store one or two versions of them (again, the latest).
Is there any good way I could achieve this so I can be completely sure what versions of programs are being installed, and then upgrade them periodically in a safe testing environment? I really do not want to "trust" everything will work as expected for long time as long as I install apache2
instead of apache3
and so on.
Thanks in advance.