3 ms·
The idea is that your container image is the thing you want, and is (relatively) immutable, so you delete and create containers when you want things to change.
by danudey 11mo ago
The idea is that your container image is the thing you want, and is (relatively) immutable, so you delete and create containers when you want things to change. If you need state you can do that with volume mounts, but the idea is that you don't need to 'update' a container, you just replace it with a new one.
That's also what docker compose does, under the hood. It doesn't 'update' a container, it just deletes it and recreates it with the new image and the same settings/name/ports/volumes/etc.
- martijnvds 11mo agoTo the end user, this looks exactly the same as "updating". If replacing a "regular" program that's just an executable and then restarting it is "updating", why isn't it the same for containers? Except theb the "executable" is the container image and the "running program" is the actual container. Another level would be "immutable" distributions: would you say they don't "update", they just "download a fresh image to boot from"?
- estimator7292 11mo agoIt is exactly the same thing except you as the user are wrong for wanting to "update an application" Docker is weird and they sure do have some Opinions. I try to avoid it.