Good. You could check the history of the Docker image, which shows all the commands that have been executed to create the image:
docker history --no-trunc <nombre_de_la_imagen>
When executing the command, you will have to read the output from the bottom up, that is, the first of the lines that will appear as executed will be the one that has actually been executed.
For example, suppose an image 'myApp', which has been created with the following Dockerfile (we have used JHipster to create an application):
FROM openjdk:8-jre-alpine
ENV JHIPSTER_SLEEP 0
# add directly the war
ADD *.war /app.war
RUN sh -c 'touch /app.war'
VOLUME /tmp
EXPOSE 8081 5701/udp
CMD echo "The application will start in ${JHIPSTER_SLEEP}s..." && \
sleep ${JHIPSTER_SLEEP} && \
java -Djava.security.egd=file:/dev/./urandom -jar /app.war
When executing the command:docker history --no-trunc myApp
The following output appears:
IMAGE CREATED CREATED BY SIZE COMMENT
sha256:dbf12857bb6dbef4fbd58a06c5e01d29726995bfead13edf1c491dca6f791577 2 days ago /bin/sh -c #(nop) CMD ["/bin/sh" "-c" "echo \"The application will start in ${JHIPSTER_SLEEP}s...\" && sleep ${JHIPSTER_SLEEP} && java -Djava.security.egd=file:/dev/./urandom -jar /app.war"] 0 B
sha256:8f66dc5d6b1cef915df5706355e909982332b048a3337d7b430c31f70a80ea96 2 days ago /bin/sh -c #(nop) EXPOSE 5701/udp 8081/tcp 0 B
sha256:00ff2fef4300da373448c291d2a069845fe096d588409f9786cf24d9bd300489 2 days ago /bin/sh -c #(nop) VOLUME [/tmp] 0 B
sha256:015ca591751aefc6769e401dffffe8d33bb02db4ac78e2204f6f74f99f82b6c4 2 days ago /bin/sh -c sh -c 'touch /app.war' 78.5 MB
sha256:16493673fba5614aed0e081561d06179e2c74b736bd5cc0e9d770e7b7fafa2d5 2 days ago /bin/sh -c #(nop) ADD file:07ed3b8186f676133e1f17d978b0d6d49f12656607a1715179352dd1ea3185d4 in /app.war 78.5 MB
sha256:57407401fdc757e0574e94c6b5f44794fe524b00eda16e38fe7feaccff26e5af 2 days ago /bin/sh -c #(nop) ENV JHIPSTER_SLEEP=0 0 B
sha256:d85b17c6762eb3455c7b7ff1930bdde8c911137fe8c7f3c0b5988c66149dc27b 2 months ago /bin/sh -c set -x && apk add --no-cache openjdk8-jre="$JAVA_ALPINE_VERSION" && [ "$JAVA_HOME" = "$(docker-java-home)" ] 103 MB
<missing> 2 months ago /bin/sh -c #(nop) ENV JAVA_ALPINE_VERSION=8.111.14-r0 0 B
<missing> 2 months ago /bin/sh -c #(nop) ENV JAVA_VERSION=8u111 0 B
<missing> 2 months ago /bin/sh -c #(nop) ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin 0 B
<missing> 2 months ago /bin/sh -c #(nop) ENV JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk/jre 0 B
<missing> 2 months ago /bin/sh -c { echo '#!/bin/sh'; echo 'set -e'; echo; echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; } > /usr/local/bin/docker-java-home && chmod +x /usr/local/bin/docker-java-home 87 B
<missing> 2 months ago /bin/sh -c #(nop) ENV LANG=C.UTF-8 0 B
<missing> 2 months ago /bin/sh -c #(nop) ADD file:eeed5f514a35d18fcd9cbfe6c40c582211020bffdd53e4799018d33826fe5067 in / 4.8 MB
Look in the column 'CREATED BY', in the executed commands. You will see that the ones that say CREATED 2 days ago correspond to the Dockerfile commands, and the ones that say CREATED 2 months ago are the ones that correspond to the openjdk:8-jre-alpine image that we imported with the FROM in the Dockerfile.
Good. You could check the history of the Docker image, which shows all the commands that have been executed to create the image:
When executing the command, you will have to read the output from the bottom up, that is, the first of the lines that will appear as executed will be the one that has actually been executed.
For example, suppose an image 'myApp', which has been created with the following Dockerfile (we have used JHipster to create an application):
When executing the command:
docker history --no-trunc myApp
The following output appears:
Look in the column 'CREATED BY', in the executed commands. You will see that the ones that say CREATED 2 days ago correspond to the Dockerfile commands, and the ones that say CREATED 2 months ago are the ones that correspond to the openjdk:8-jre-alpine image that we imported with the FROM in the Dockerfile.
All the best