question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Created timestamp is wrong for newly built docker image

See original GitHub issue

Environment:

  • 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:

  1. Generate a demo spring boot app using an initializer
  2. Add the below content to pom.xml under plugins section
  3. 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:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
loosebazookacommented, Mar 29, 2020

@ppiotrow are you asking how to set the created when doing docker build?

0reactions
chanseokohcommented, Mar 29, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker Image Timestamp Issue - Stack Overflow
I've created a brand new image but ...
Read more >
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found