17

How do I pull an older build of a 3rd party image from Docker Hub?

For example I would like to pull this build of appropriate/curl.

I've tried using the "Build Code" as the tag, as well as the partial SHA256 of the image shown at the end of the build, and neither work.

Note: this is different from Docker: How do I pull a specific build-id? since the author of that question is able to fork the version and tag their own builds as a workaround. I'm trying to access something that was built in the past (to analyze a regression).

scjody
  • 959
  • 2
  • 7
  • 12

3 Answers3

26

You need the digest ID.

For example:

docker pull postgres@sha256:500edc08fa825dbf3f28dceced99fe84b8a4211d7a45fc0062250d4efb0f64c5

Some of the projects may have additional history available to retrieve an old digest id. For example these projects: https://github.com/docker-library/repo-info/tree/master/repos

Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
3

You can use the digest ID only if the image doesn't have a tag. FROM is either FROM image:tag or FROM image:hash. This is just really bad when you want to pull debian:jessie@c856411d1c21111855a54c5d29f2bfe099d63ce7

gazorpazorp
  • 468
  • 3
  • 13
  • 3
    This is not true. And it makes no sense to write `debian:jessie@c856411d1c21111855a54c5d29f2bfe099d63ce7`, it should be `debian@sha256:c856411d1c21111855a54c5d29f2bfe099d63ce7`. The tag does not matter when you already know its digest ID. – castarco Jun 17 '20 at 10:18
1

I am afraid it's not possible. Build Details tab shows no tags other than latest and edge, which were overwritten each time a build was made.

Try to contact the image contributor. This is his github profile, where you can find his email address: https://github.com/md5

He might provide you a previous version taken from some of his old commits.

Sergei Krivosheenko
  • 1,136
  • 7
  • 17
  • 1
    That's what I thought. Thanks for the confirmation. Docker is the PHP of infrastructure :( – scjody Dec 06 '17 at 20:28
  • 2
    Actually this response is not correct, as Chris Stryczynski correctly pointed out. And as an extra: I made the experiment of replacing a tagged image by a new one, and the digest ID continues to work (at least for the short term) – castarco Jun 17 '20 at 10:16