简体   繁体   中英

docker base image: how to upgrade

I'm just starting with docker, and this question probably clearly shows that I'm not really understanding the base concepts yet, but I can't figure it out.

So, I want to use this image as my "base" image: https://registry.hub.docker.com/u/phusion/baseimage/

Now, this base image has a number of tags (versions). The most recent one is 0.9.11. So, let's say I'll spin up a number of images based on this "base" image and push those to production.

Then Phusion guys will push some updates to that image and I would want to upgrade not just the actual base image but also all of the images I already use on prod (based on the "base" image).

So how would I do that?

=================

Extra question:

The other case I assume should be perfectly possible: The base image has some common lib, openssl , for example. Now there's a new bug discovered and I need to upgrade to newer openssl version.

Is this possible to upgrade the openssl on the base image, commit it to my local registry, and pull that change on all images that are based on that "base" image?

When you build a Dockerfile , instructions are read from top to bottom using cache as much as possible. The first time it encounters a command that changed or a new command, the cache is busted.

The FROM directive is usually at the top of the Dockerfile , so if you change the tag of your base image, the whole Dockerfile will be re-built from scratch.

And that's how you "update" a base image, you rebuild all your containers from their Dockerfiles, you don't "push" the changes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM