Skip to content

Instantly share code, notes, and snippets.

@ppiotrow
Created April 5, 2020 16:30
Show Gist options
  • Save ppiotrow/2d055bf05fef11c6095ccf720e023d41 to your computer and use it in GitHub Desktop.
Save ppiotrow/2d055bf05fef11c6095ccf720e023d41 to your computer and use it in GitHub Desktop.
Docker base image sha on the file creation, modification date. Docker layers are timestamped.
echo "FROM openjdk:14-alpine\nRUN echo \${JAVA_HOME}" > Dockerfile
docker build --tag my-java:latest . # No cache, Successfully built c60c9be06bcb
docker build --tag my-java:latest . # Fully cached, Successfully built c60c9be06bcb
docker rmi my-java:latest
docker build --tag my-java:latest . # Totally new image, Successfully built 514662e21b60
docker build --no-cache --tag my-java:latest . # no-cache flag, Successfully built 364da4d3ef39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment