Created timestamp is wrong for newly built docker image
See original GitHub issueEnvironment:
- Jib version: 1.8.0
- Build tool: Apache Maven 3.6.0
- OS: Ubuntu 18.04.3 LTS
Description of the issue:
When I build a docker image for spring boot application using jib maven plugin, the creation date says 50 years ago
which is really strange
springbootjib latest 008a4f225d1d 50 years ago 141MB
Expected behavior:
Expected behavior: The created date should reflect the latest time when it was created
Steps to reproduce:
- Generate a demo spring boot app using an initializer
- Add the below content to
pom.xml
underplugins
section - Run the command
mvn compile jib:dockerBuild
to generate docker image.
jib-maven-plugin
Configuration:
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>1.8.0</version>
<configuration>
<to>
<image>springbootjib</image>
</to>
</configuration>
</plugin>
</plugins>
jib-gradle-plugin
Configuration:
PASTE YOUR build.gradle CONFIGURATION HERE
Log output:
[INFO]
[INFO] Containerizing application to Docker daemon as springbootjib...
[WARNING] Base image 'gcr.io/distroless/java:8' does not use a specific image digest - build may not be reproducible
[INFO] Using base image with digest: sha256:65d23224482a20dedb62c94d258706f3949c02bd0522a97fee08d17ab38f1813
[INFO]
[INFO] Container entrypoint set to [java, -cp, /app/resources:/app/classes:/app/libs/*, com.example.demo.DemoApplication]
[INFO]
[INFO] Built image to Docker daemon as springbootjib
[INFO] Executing tasks:
[INFO] [==============================] 100.0% complete
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.565 s
[INFO] Finished at: 2020-01-28T14:01:21Z
[INFO] ------------------------------------------------------------------------
Additional Information:
As can be seen from the above output, the image was created on Finished at: 2020-01-28T14:01:21Z
but the docker timestamp is different
springbootjib latest 008a4f225d1d 50 years ago 141MB
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Container Registry shows image was published 20 years ago
Summary Container Registry shows wrong creation date when created by ... strip timestamps out of the built image and make it reproducible.
Read more >Troubleshoot common issues - Azure Container Instances
This article shows how to troubleshoot common issues for managing or deploying containers to Azure Container Instances.
Read more >Should You Try to Set Environment Variables Based on a ...
A new container starts, sets an environment variable, an image is saved from the container and the new VARIABLE is not in it....
Read more >Engine API v1.24 - Docker Documentation
Status codes: 200 – no error; 400 – bad parameter; 500 – server error. Create a container. POST /containers/create.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ppiotrow are you asking how to set the
created
when doingdocker build
?Just FYI, the
created
timestamp is a relatively minor issue concerning reproducibility, because it only affects a small metadata JSON. A much bigger problem is that you can’t build image layers reproducibility because of changing file timestamps. Therefore, I guess it is far more important to change modification time of actual files on your file system when you use the Docker API.