Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last modified date is set to "never" #11916

Closed
nwertzberger opened this issue Mar 30, 2015 · 7 comments
Closed

Last modified date is set to "never" #11916

nwertzberger opened this issue Mar 30, 2015 · 7 comments

Comments

@nwertzberger
Copy link

I'm not sure if this should be open with you or with every project that decided to sanity-check the last-modified date by comparing it against 0, but it appears that, by default, a docker image will (rightfully?) set the last-modified date of a file to an epoch time of 0.

This makes some amount of sense, but does lead at least spring-core's sanity checker for AbstractResource to freak out. I had to log into the image and modify the image in order to make this go away.

My proposed solution? Honor the last modified dates in the original files, have a way to declare what date i am modifying by, or use the date that Docker built the image at. All of these sound more truthful than saying it happened on Jan 1, 1970.

@jhoeller
Copy link

Echoing my comment from https://jira.spring.io/browse/SPR-12862, please note that java.io.File.lastModified() is defined to return 0 as an indicator for a non-existing file or an I/O error when checking the underlying resource.

So any Java-based code is unable to differentiate between actual Jan 1, 1970 timestamps and I/O errors. Setting the timestamp one second ahead to Jan 1, 1970, 0:00:01 would help already :-)

@amouat
Copy link
Contributor

amouat commented Mar 31, 2015

@nwertzberger Can you explain how you managed to create these files? Which filesystem are you using?

When I add a file to a container with COPY or ADD, it gets the date from the file. Could you append your output from docker info and docker version as well?

@nwertzberger
Copy link
Author

I'm using boot2docker on mac osx.

docker info:

Containers: 5
Images: 66
Storage Driver: aufs
 Root Dir: /mnt/sda1/var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 76
Execution Driver: native-0.2
Kernel Version: 3.18.5-tinycore64
Operating System: Boot2Docker 1.5.0 (TCL 5.4); master : a66bce5 - Tue Feb 10 23:31:27 UTC 2015
CPUs: 8
Total Memory: 1.961 GiB
Name: boot2docker
ID: HDPA:AVW5:FDOC:BDUE:YR44:YB6U:NXO4:44GY:FWMZ:Y67Q:Y6KS:4BXU
Debug mode (server): true
Debug mode (client): false
Fds: 28
Goroutines: 37
EventsListeners: 0
Init Path: /usr/local/bin/docker
Docker Root Dir: /mnt/sda1/var/lib/docker

docker version:

Client version: 1.5.0
Client API version: 1.17
Go version (client): go1.4.1
Git commit (client): a8a31ef
OS/Arch (client): darwin/amd64
Server version: 1.5.0
Server API version: 1.17
Go version (server): go1.4.1
Git commit (server): a8a31ef

@nwertzberger
Copy link
Author

Also, here's my Dockerfile. I am using the ADD tool's functionality for adding tarballs.

FROM java:8
MAINTAINER Nicholas Wertzberger

ADD decision-engine/*.tar.gz /

EXPOSE 9030
EXPOSE 9010
EXPOSE 9009

CMD touch -m /decision-engine/etc/pages/*
ENTRYPOINT /decision-engine/bin/decision-engine console

@bquenin
Copy link

bquenin commented May 4, 2015

+1

@jessfraz
Copy link
Contributor

Hello!
We are no longer accepting patches to the Dockerfile syntax as you can read about here: https://github.com/docker/docker/blob/master/ROADMAP.md#22-dockerfile-syntax

Mainly:

Allowing the Builder to be implemented as a separate utility consuming the Engine's API will open the door for many possibilities, such as offering alternate syntaxes or DSL for existing languages without cluttering the Engine's codebase

Then from there, patches/features like this can be re-thought. Hope you can understand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants