It looks like docker image history
could be something that could help you identify those kind of changes.
Here is the full example of it on the tag and digest you are using as an example:
$ docker image history --no-trunc 34982ce484b5
IMAGE CREATED CREATED BY SIZE COMMENT
sha256:34982ce484b5d709bffb6bf8cca2163ff9231d1a900305f888a5baf59a3414cd 4 weeks ago /bin/sh -c CONDA_VERSION="4.5.12" && CONDA_MD5_CHECKSUM="866ae9dff53ad0874e1d1a60b1ad1ef8" && apk add --no-cache --virtual=.build-dependencies wget ca-certificates bash && mkdir -p "$CONDA_DIR" && wget "http://repo.continuum.io/miniconda/Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh" -O miniconda.sh && echo "$CONDA_MD5_CHECKSUM miniconda.sh" | md5sum -c && bash miniconda.sh -f -b -p "$CONDA_DIR" && echo "export PATH=$CONDA_DIR/bin:\$PATH" > /etc/profile.d/conda.sh && rm miniconda.sh && conda update --all --yes && conda config --set auto_update_conda False && rm -r "$CONDA_DIR/pkgs/" && apk del --purge .build-dependencies && mkdir -p "$CONDA_DIR/locks" && chmod 777 "$CONDA_DIR/locks" 190MB
<missing> 4 weeks ago /bin/sh -c #(nop)ENV PATH=/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 0B
<missing> 4 weeks ago /bin/sh -c #(nop)ENV CONDA_DIR=/opt/conda 0B
<missing> 6 weeks ago /bin/sh -c ALPINE_GLIBC_BASE_URL="https://github.com/sgerrand/alpine-pkg-glibc/releases/download" && ALPINE_GLIBC_PACKAGE_VERSION="2.29-r0" && ALPINE_GLIBC_BASE_PACKAGE_FILENAME="glibc-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && ALPINE_GLIBC_BIN_PACKAGE_FILENAME="glibc-bin-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && ALPINE_GLIBC_I18N_PACKAGE_FILENAME="glibc-i18n-$ALPINE_GLIBC_PACKAGE_VERSION.apk" && apk add --no-cache --virtual=.build-dependencies wget ca-certificates && echo "-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApZ2u1KJKUu/fW4A25y9m y70AGEa/J3Wi5ibNVGNn1gT1r0VfgeWd0pUybS4UmcHdiNzxJPgoWQhV2SSW1JYu tOqKZF5QSN6X937PTUpNBjUvLtTQ1ve1fp39uf/lEXPpFpOPL88LKnDBgbh7wkCp m2KzLVGChf83MS0ShL6G9EQIAUxLm99VpgRjwqTQ/KfzGtpke1wqws4au0Ab4qPY KXvMLSPLUp7cfulWvhmZSegr5AdhNw5KNizPqCJT8ZrGvgHypXyiFvvAH5YRtSsc Zvo9GI2e2MaZyo9/lvb+LbLEJZKEQckqRj4P26gmASrZEPStwc+yqy1ShHLA0j6m 1QIDAQAB -----END PUBLIC KEY-----" | sed 's/ */\n/g' > "/etc/apk/keys/sgerrand.rsa.pub" && wget "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" "$ALPINE_GLIBC_BASE_URL/$ALPINE_GLIBC_PACKAGE_VERSION/$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && apk add --no-cache "$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" "$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" "$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" && rm "/etc/apk/keys/sgerrand.rsa.pub" && /usr/glibc-compat/bin/localedef --force --inputfile POSIX --charmap UTF-8 "$LANG" || true && echo "export LANG=$LANG" >/etc/profile.d/locale.sh && apk del glibc-i18n && rm "/root/.wget-hsts" && apk del .build-dependencies && rm "$ALPINE_GLIBC_BASE_PACKAGE_FILENAME" "$ALPINE_GLIBC_BIN_PACKAGE_FILENAME" "$ALPINE_GLIBC_I18N_PACKAGE_FILENAME" 6.71MB
<missing> 6 weeks ago /bin/sh -c #(nop)ENV LANG=C.UTF-8 0B
<missing> 8 weeks ago /bin/sh -c #(nop)CMD ["/bin/sh"] 0B
<missing> 8 weeks ago /bin/sh -c #(nop) ADD file:2a1fc9351afe35698918545b2d466d9805c2e8afcec52f916785ee65bbafeced in / 5.53MB
On the fourth line of the output, I can see that 6 weeks ago the image seems to have changed by a shell command that start with ALPINE_GLIBC_BASE_URL=...
, which is exactly the first RUN
command of the parent image.
So indeed, here you can see that this image has changed, in time, there, due to this.
But and here is the important point for you: you can also see that docker image is composed of the RUN
of its parent image, and does not contains any reference to it whatsoever (you can also run a docker image inspect [image_digest]
, to double check this).
Meaning that docker squashes every parts of an image together and make the digests out of what commands created the image in the first place, not from the fact that the FROM
did not change but the underlaying image did.
So I would highly suspect, with that in mind and with the reference to this other answer about digest that if you FROM
image change, then the resulting digest won't be the same, meaning that you will still be protected in that case.