alexanoid
alexanoid

Reputation: 25882

Docker get previous image with FROM

Is it possible with Docker to get a previous version of Docker image(not the current one), for example:

FROM base:previous

or something like this. Unfortunately, I don't know this image digest.

Upvotes: 0

Views: 795

Answers (1)

Andreas Wederbrand
Andreas Wederbrand

Reputation: 40061

In your example previous is the tag of the image. If you know the tag of the older image just write that.

As an example the official mysql image (https://hub.docker.com/_/mysql/) lists several tags ranging from 5.5 to 8.0

So I can start an instance of mysql 5.5 using

docker run mysql:5.5

You could also do that in your Dockerfile, if the older version is 1.0 you would do:

FROM base:1.0

If you don't know which tag you used previously you might be able to find it if you list all your images locally

docker images

Good luck!

Upvotes: 2

Related Questions