Tracing an image's parents through multiple official image builds

I’m a little confused when trying to trace the different build steps which result in an official image. I suspect that I need to add caching_sha2_password support to the wordpress command-line image that I use (I may be wrong in this, but it’s the problem which started my inspection of the official image builds).

The image I’m using is tagged wordpress:cli. Looking at the wordpress official image page I see that this tag appears with other tag variants (cli-2.11.0, cli-2.11, cli-2, cli, cli-2.11.0-php8.2, cli-2.11-php8.2, cli-2-php8.2, cli-php8.2) which point to the Dockerfile at wordpress/cli/php8.2/alpine/Dockerfile at aa3c30f8c0a6a5ba0e1b26f73be802dfc8f18e4f · docker-library/wordpress · GitHub. This Dockerfile has a path of cli/php8.2/alpine/Dockerfile. It’s parent image is “FROM php:8.2-alpine”.

If I go to docker-library/php repository I can find the 8.2 directory which has four subdirectories: alpine3.20, alpine3.21, bookworm, and bullseye. Well, I know that the wp cli parent is an alpine variant, but how do I know if it’s built off of php/8.2/alpine3.20 or php/8.2/alpine3.21?

Have I made a mistake/faulty assumptions in how I trace the provenance of an image?

Thanks for taking the time to read my question.
Terrence

Go to the wordpress image description on Docker Hub, then to the Tags tab. Search for the tag, click on the link and you can find this for example:

https://hub.docker.com/layers/library/wordpress/cli/images/sha256-af464aba2afd9cb3a532949613e7f46ae6d022377cdbbbd2812d1fd41a509dc4

That shows the related image repositories. “php” in your case, but the tag can change, so it just shows a hash. You can expand that “php” section and see it’s base, which was “alpine” indeed.

Some time ago you would only see a hash in the first COPY or ADD layer, but now you can see the actual filenames. Like this in your case:

ADD alpine-minirootfs-3.21.3-x86.tar.gz / # buildkit

That shows the exact version, but even without this, you could start a container from the image and cat the alpine version inside.

docker run --rm -it wordpress:cli cat /etc/os-release

Output:

NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.21.3
PRETTY_NAME="Alpine Linux v3.21"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.