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

Use EPOCH timestamp as a file modification timestamp when adding libs docker layer #26735

Closed
wants to merge 9 commits into from

Conversation

fbotis
Copy link
Contributor

@fbotis fbotis commented Jul 14, 2022

Use Instant.EPOCH when adding libsMainPath layers so if the content of the files do not change the layer digest doesn't change either

Fixes: 26734

…f the files do not change the layer digest doesn't change either
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 14, 2022

Thanks for your pull request!

The title of your pull request does not follow our editorial rules. Could you have a look?

  • title should not end up with ellipsis (make sure the title is complete)

This message is automatically generated by a bot.

@fbotis fbotis changed the title Use Instant.EPOCH when adding libsMainPath layers so if the content o… Use Instant.EPOCH for libs docker layer Jul 14, 2022
@fbotis fbotis changed the title Use Instant.EPOCH for libs docker layer Use Instant.EPOCH for libs docker layer #26734 Jul 14, 2022
@fbotis fbotis changed the title Use Instant.EPOCH for libs docker layer #26734 Use EPOCH timestamp as a file modification timestamp when adding libs docker layer Jul 14, 2022
Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

I don't think we want to limit to only that layer - I think the setting should be for all layers

Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update.

I added a comment about the documentation.

We'll also need the commits squashed


/**
* Whether to set the modification time (last modified time) of the files put by Jib in the image to the actual
* build time. Otherwise, the modification time will be set to the Unix epoch (00:00:00, January 1st, 1970 in UTC).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also explain what this does, basically what the effect of turning it off means for layering.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appending something like the paragraph below?

If the modification time is constant (flag is set to false so Unix epoch is used) across two consecutive builds, the docker layer sha256 digest will be different only if the actual files added by Jib to the docker layer were changed. More exactly, having 2 consecutive builds will generate different docker layers only if the actual content of the files within the docker layer was changed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

fbotis added 3 commits July 15, 2022 13:02
Use Instant.EPOCH when adding docker layers so if the content of the files do not change the layer digest doesn't change either
@gsmet
Copy link
Member

gsmet commented Jul 18, 2022

Superseded by #26758 .

@gsmet gsmet closed this Jul 18, 2022
@quarkus-bot quarkus-bot bot added the triage/invalid This doesn't seem right label Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage/invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JIB Extension and docker layers
3 participants