问题原文
原帖链接 · MortyAndFam · CC BY-SA 4.0
new to Docker here and I am trying to make it right.
I want to create a docker container to 'deep freeze' an application created with bash scripts and a lot of dependencies, so that I don't have to maintain it as much anymore. I think docker is going to help me with that. Is it a good practice to put update/upgrade statements inside the Dockerfile like 'apt-get upgrade'? Wouldn't that potentially break the application in the future which is what docker should prevent?
社区高分解答
原帖链接 · Håkan Lindqvist · CC BY-SA 4.0
The main reason why you'll want to either use an updated base image (which itself been built from up-to-date packages) or update it yourself (eg, apt-get upgrade) is to get security fixes, as well as other bug fixes.
You don't say much about what software is in there, but "a lot of dependencies" probably means there will be security fixes to track.
The overall idea for using containers is that you build an up-to-date image with the software you need, test it, it then stays frozen throughout its lifetime and later gets discarded as a whole when a new version is released and a new image is deployed.
From a security perspective, this of course implies regular releases.
As for what you will get in terms of updated packages in Debian (if we assume Debian, from your use of apt-get), they have stable (ie, unchanging) releases. Ie, they don't ship new versions of the packaged software (with rare exceptions), but backport fixes to their packaged version.
This may be helpful in your "deep freeze" effort, as the chance of changed behaviour is much lower than with new versions.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
