Passer au contenu principal

Obtenir des infos sur une image docker

Commande

Attention, les actions se lisent de bas en haut.

docker history --format "{{.CreatedBy}}" --no-trunc <image>

Exemple

docker history --format "{{.CreatedBy}}" --no-trunc cthulhoo/ttrss-web-nginx 
COPY nginx.conf /etc/nginx/nginx.conf # buildkit
HEALTHCHECK &{["CMD-SHELL" "curl --fail http://localhost/tt-rss/index.php || exit 1"] "0s" "0s" "0s" '\x00'}
/bin/sh -c #(nop)  CMD ["nginx" "-g" "daemon off;"]
/bin/sh -c #(nop)  STOPSIGNAL SIGQUIT
/bin/sh -c #(nop)  EXPOSE 80
/bin/sh -c #(nop)  ENTRYPOINT ["/docker-entrypoint.sh"]
/bin/sh -c #(nop) COPY file:09a214a3e07c919af2fb2d7c749ccbc446b8c10eb217366e5a65640ee9edcc25 in /docker-entrypoint.d
/bin/sh -c #(nop) COPY file:0fd5fca330dcd6a7de297435e32af634f29f7132ed0550d342cad9fd20158258 in /docker-entrypoint.d
/bin/sh -c #(nop) COPY file:0b866ff3fc1ef5b03c4e6c8c513ae014f691fb05d530257dfffd07035c1b75da in /docker-entrypoint.d
/bin/sh -c #(nop) COPY file:65504f71f5855ca017fb64d502ce873a31b2e0decd75297a8fb0a287f97acf92 in /
/bin/sh -c set -x     && addgroup -g 101 -S nginx     && adduser -S -D -H -u 101 -h /var/cache/nginx -s /sbin/nologin -G nginx -g nginx nginx     && apkArch="$(cat /etc/apk/arch)"     && nginxPackages="         nginx=${NGINX_VERSION}-r${PKG_RELEASE}         nginx-module-xslt=${NGINX_VERSION}-r${PKG_RELEASE}         nginx-module-geoip=${NGINX_VERSION}-r${PKG_RELEASE}         nginx-module-image-filter=${NGINX_VERSION}-r${PKG_RELEASE}         nginx-module-njs=${NGINX_VERSION}.${NJS_VERSION}-r${PKG_RELEASE}     "     && apk add --no-cache --virtual .checksum-deps         openssl     && case "$apkArch" in         x86_64|aarch64)             set -x             && KEY_SHA512="e7fa8303923d9b95db37a77ad46c68fd4755ff935d0a534d26eba83de193c76166c68bfe7f65471bf8881004ef4aa6df3e34689c305662750c0172fca5d8552a *stdin"             && wget -O /tmp/nginx_signing.rsa.pub https://nginx.org/keys/nginx_signing.rsa.pub             && if [ "$(openssl rsa -pubin -in /tmp/nginx_signing.rsa.pub -text -noout | openssl sha512 -r)" = "$KEY_SHA512" ]; then                 echo "key verification succeeded!";                 mv /tmp/nginx_signing.rsa.pub /etc/apk/keys/;             else                 echo "key verification failed!";                 exit 1;             fi             && apk add -X "https://nginx.org/packages/mainline/alpine/v$(egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release)/main" --no-cache $nginxPackages             ;;         *)
set -x             && tempDir="$(mktemp -d)"             && chown nobody:nobody $tempDir             && apk add --no-cache --virtual .build-deps                 gcc                 libc-dev                 make                 openssl-dev                 pcre2-dev                 zlib-dev                 linux-headers                 libxslt-dev                 gd-dev                 geoip-dev                 perl-dev                 libedit-dev                 bash
   alpine-sdk                 findutils             && su nobody -s /bin/sh -c "                 export HOME=${tempDir}                 && cd ${tempDir}                 && curl -f -O https://hg.nginx.org/pkg-oss/archive/${NGINX_VERSION}-${PKG_RELEASE}.tar.gz                 && PKGOSSCHECKSUM=\"513952f1e0432e667a8e3afef791a2daa036911f35573c849712747f10418f3f5b8712faf75fcb87f91bfaf593622b1e1c4f38ad9fef830f4cae141357206ecd *${NGINX_VERSION}-${PKG_RELEASE}.tar.gz\"                 && if [ \"\$(openssl sha512 -r ${NGINX_VERSION}-${PKG_RELEASE}.tar.gz)\" = \"\$PKGOSSCHECKSUM\" ]; then                     echo \"pkg-oss tarball checksum verification succeeded!\";                 else                     echo \"pkg-oss tarball checksum verification failed!\";                     exit 1;                 fi                 && tar xzvf ${NGINX_VERSION}-${PKG_RELEASE}.tar.gz                 && cd pkg-oss-${NGINX_VERSION}-${PKG_RELEASE}                 && cd alpine                 && make all                 && apk index -o ${tempDir}/packages/alpine/${apkArch}/APKINDEX.tar.gz ${tempDir}/packages/alpine/${apkArch}/*.apk                 && abuild-sign -k ${tempDir}/.abuild/abuild-key.rsa ${tempDir}/packages/alpine/${apkArch}/APKINDEX.tar.gz                 "             && cp ${tempDir}/.abuild/abuild-key.rsa.pub /etc/apk/keys/             && apk del .build-deps             && apk add -X ${tempDir}/packages/alpine/ --no-cache $nginxPackages             ;;     esac     && apk del .checksum-deps     && if [ -n "$tempDir" ]; then rm -rf "$tempDir"; fi     && if [ -n "/etc/apk/keys/abuild-key.rsa.pub" ]; then rm -f /etc/apk/keys/abuild-key.rsa.pub; fi     && if [ -n "/etc/apk/keys/nginx_signing.rsa.pub" ]; then rm -f /etc/apk/keys/nginx_signing.rsa.pub; fi     && apk add --no-cache --virtual .gettext gettext     && mv /usr/bin/envsubst /tmp/         && runDeps="$(         scanelf --needed --nobanner /tmp/envsubst             | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }'             | sort -u             | xargs -r apk info --installed             | sort -u     )"     && apk add --no-cache $runDeps     && apk del .gettext     && mv /tmp/envsubst /usr/local/bin/     && apk add --no-cache tzdata     && apk add --no-cache curl ca-certificates     && ln -sf /dev/stdout /var/log/nginx/access.log     && ln -sf /dev/stderr /var/log/nginx/error.log     && mkdir /docker-entrypoint.d
/bin/sh -c #(nop)  ENV PKG_RELEASE=1
/bin/sh -c #(nop)  ENV NJS_VERSION=0.7.6
/bin/sh -c #(nop)  ENV NGINX_VERSION=1.23.1
/bin/sh -c #(nop)  LABEL maintainer=NGINX Docker Maintainers <docker-maint@nginx.com>
/bin/sh -c #(nop)  CMD ["/bin/sh"]
/bin/sh -c #(nop) ADD file:2a949686d9886ac7c10582a6c29116fd29d3077d02755e87e111870d63607725 in /

Et pour obtenir une mise en page qui va bien, c'est à dire avec des retours à la ligne :

$ docker history --format "{{.CreatedBy}}" --no-trunc collabora/code:latest | perl -p -e 's/(?=[ ]{2,})(?<![ ])/\n/g'
CMD ["/start-collabora-online.sh"]
USER 100
EXPOSE map[9980/tcp:{}]
COPY /scripts/start-collabora-online.pl / # buildkit
COPY /scripts/start-collabora-online.sh / # buildkit
RUN |4 repo= type= nobrand= noinotifywait= /bin/sh -c apt-get update &&
     apt-get -y install cpio tzdata libcap2-bin apt-transport-https gnupg2 ca-certificates curl &&
     repourl="https://collaboraoffice.com/${repo:-repos}/CollaboraOnline/";
     secret_key=$(cat /run/secrets/secret_key);
     if [ "$type" = "cool" ] && [ -n ${secret_key+set} ]; then
         echo "Based on the provided build arguments Collabora Online from customer repo will be used.";
         repourl="${repourl}23.05/customer-deb-${secret_key}/";
     elif [ "$type" = "key" ]; then
         echo "Based on the provided build arguments license key enabled Collabora Online will be used.";
         repourl="${repourl}23.05-key/";
     else
         echo "Based on the provided build arguments Collabora Online Development Edition will be used.";
         repourl="${repourl}23.05-CODE/CODE-deb/";
     fi &&
     echo "deb [signed-by=/usr/share/keyrings/collaboraonline-release-keyring.gpg] ${repourl} /" > /etc/apt/sources.list.d/collabora.list &&
     if [ "$repo" = "repos-snapshot" ]; then
         curl https://www.collaboraoffice.com/downloads/gpg/collaboraonline-snapshot-keyring.gpg --output /usr/share/keyrings/collaboraonline-snapshot-keyring.gpg;
         sed -i "s/collaboraonline-release-keyring/collaboraonline-snapshot-keyring/" /etc/apt/sources.list.d/collabora.list;
     else
         curl https://www.collaboraoffice.com/downloads/gpg/collaboraonline-release-keyring.gpg --output /usr/share/keyrings/collaboraonline-release-keyring.gpg;
     fi &&
     apt-get update &&
     apt-get -y install coolwsd
                        collaboraoffice-dict-*
                        collaboraofficebasis-ar
                        collaboraofficebasis-bg
                        collaboraofficebasis-ca
                        collaboraofficebasis-cs
                        collaboraofficebasis-da
                        collaboraofficebasis-de
                        collaboraofficebasis-el
                        collaboraofficebasis-en-gb
                        collaboraofficebasis-en-us
                        collaboraofficebasis-eo
                        collaboraofficebasis-es
                        collaboraofficebasis-eu
                        collaboraofficebasis-fi
                        collaboraofficebasis-fr
                        collaboraofficebasis-gl
                        collaboraofficebasis-he
                        collaboraofficebasis-hr
                        collaboraofficebasis-hu
                        collaboraofficebasis-id
                        collaboraofficebasis-is
                        collaboraofficebasis-it
                        collaboraofficebasis-ja
                        collaboraofficebasis-ko
                        collaboraofficebasis-lo
                        collaboraofficebasis-nb
                        collaboraofficebasis-nl
                        collaboraofficebasis-oc
                        collaboraofficebasis-pl
                        collaboraofficebasis-pt
                        collaboraofficebasis-pt-br
                        collaboraofficebasis-ru
                        collaboraofficebasis-sk
                        collaboraofficebasis-sl
                        collaboraofficebasis-sq
                        collaboraofficebasis-sv
                        collaboraofficebasis-tr
                        collaboraofficebasis-uk
                        collaboraofficebasis-vi
                        collaboraofficebasis-zh-cn
                        collaboraofficebasis-zh-tw &&
     if [ -z "$nobrand" ]; then
         if [ "$type" = "cool" ] || [ "$type" = "key" ]; then
             apt-get -y install collabora-online-brand;
         else
             apt-get -y install code-brand;
         fi;
     fi &&
     if [ -z "$noinotifywait" ]; then
         apt-get -y install inotify-tools psmisc;
     fi &&
     chown cool:cool /etc/coolwsd &&
     rm -rf /var/lib/apt/* &&
     rm -rf /etc/coolwsd/proof_key* # buildkit
ENV LC_CTYPE=C.UTF-8
ARG noinotifywait
ARG nobrand
ARG type
ARG repo
MAINTAINER Andras Timar <andras.timar@collabora.com>
/bin/sh -c #(nop)
  CMD ["bash"]
/bin/sh -c #(nop) ADD file:95a4ddc3a846636c52c273cac4e2e0d75225cde59612235c1480201b14581d9a in /