# COPY with no time

**URL:** <https://forums.docker.com/t/copy-with-no-time/150263>\
**Category:** Image Builds\
**Tags:** docker, build\
**Created:** [October 28, 2025, 2:06pm UTC](https://forums.docker.com/t/copy-with-no-time/150263 "2025-10-28T14:06:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![trajano](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/trajano/32/16038_2.png) [@trajano](https://forums.docker.com/u/trajano)\
**Post date:** [October 28, 2025, 2:06pm UTC](https://forums.docker.com/t/copy-with-no-time/150263/1 "2025-10-28T14:06:27Z")

</div>

There’s just too many issues to sift through in [GitHub · Where software is built](https://github.com/moby/moby/issues?q=is%3Aissue%20state%3Aopen%20COPY%20with%20no%20time) but I was wondering if there was a capability proposed in Dockerfile to do

```auto
COPY --no-time

```

or

```auto
COPY --mtime=0 --ctime=0

```

Which will strip off the time information of the files being copied. This will allow the layers to be cached better if the files may have been “modified” locally but the content was actually the same.

---

<div class="post-metadata">

**Author:** ![rimelek](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rimelek/32/41602_2.png) [@rimelek](https://forums.docker.com/u/rimelek)\
**Post date:** [October 28, 2025, 4:00pm UTC](https://forums.docker.com/t/copy-with-no-time/150263/2 "2025-10-28T16:00:53Z")

</div>

I could be wrong about that, but I thought layers would not be invalidated just by updating the modifiction time or creation time of the file. If it does matter, I feel it should not. I don’t see the use case when someone rebuilds an image and wants to change the time only. And if it happens sometimes for any special reason, a new RUN instruction could be addded to update that metadata.

I don’t have time to test it now, but can you confirm, you are absolutely sure the layers in the cache were invalidated because of changed mtime or ctime and not because a new line was added to the end of the file or the line endings were changed, (LF vs CRLF) or any nonprintable character was removed or added?

---

<div class="post-metadata">

**Author:** ![trajano](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/trajano/32/16038_2.png) [@trajano](https://forums.docker.com/u/trajano)\
**Post date:** [October 29, 2025, 1:17pm UTC](https://forums.docker.com/t/copy-with-no-time/150263/3 "2025-10-29T13:17:02Z")

</div>

Changing time would be the extra thing, but creating “reproducable builds” But you’re right I tested quickly by touching a file it reused the cache layers.

> For reproducibility purposes, Jib sets the creation time of the container images to the Unix epoch (00:00:00, January 1st, 1970 in UTC). If you would like to use a different timestamp, set the `jib.container.creationTime` / `<container><creationTime>` parameter to an ISO 8601 date-time. You may also use the value `USE_CURRENT_TIMESTAMP` to set the creation time to the actual build time, but this sacrifices reproducibility since the timestamp will change with every build.

> [jib/docs/faq.md at master · GoogleContainerTools/jib · GitHub](https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#why-is-my-image-created-48-years-ago)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/docker/original/3X/d/4/d4fbccd46c81bfcffe9822e20e17736d946fa821.png) [@system](https://forums.docker.com/u/system)\
**Post date:** [November 28, 2025, 1:17pm UTC](https://forums.docker.com/t/copy-with-no-time/150263/4 "2025-11-28T13:17:57Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
