Skip to content

dockerfile: ensure metadata commands have created time#778

Merged
tonistiigi merged 1 commit intomoby:masterfrom
tonistiigi:dockerfile-timestamps
Jan 18, 2019
Merged

dockerfile: ensure metadata commands have created time#778
tonistiigi merged 1 commit intomoby:masterfrom
tonistiigi:dockerfile-timestamps

Conversation

@tonistiigi
Copy link
Copy Markdown
Member

fixes #776

Fill in the timestamps for metadata commands from the surrounding layers.

Signed-off-by: Tonis Tiigi tonistiigi@gmail.com

@tonistiigi tonistiigi added this to the v0.4.0 milestone Jan 9, 2019
created = h.Created
if noCreatedTime {
continue
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This continue doesn't actually do much -- there is nothing following this in the loop anyway.

Not sure if this loop is trying to find the first or last valid h.Created from history, if you want the first then don't you want an unconditional break here? If the last you don't need anything and in either case noCreatedTime seems redundant in this loop.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actually, the loop below looks like a debugged version of this one -- is this just some leftover debug/initial version?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Its supposed to be break

Copy link
Copy Markdown

@ijc ijc Jan 10, 2019

Choose a reason for hiding this comment

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

Then is noCreatedTime useful in this variant of the loop, isn't an unconditional break fine?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We want to break after first nil record. Otherwise, the history item for a first metadata command would be the creation time of a base image layer.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

So you are looking for the second layer with a timestamp (because the first is always a base layer)? If so I think it'd be worth expanding the comment.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

First layer with a timestamp after a record without a timestamp. If there is no such then the last layer with timestamp.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@tonistiigi I think it would be very useful to sum up this conversation in a comment, because I don't think this is obvious at all.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

(probably doesn't need saying, but I agree with @tiborvass ...)

@tonistiigi tonistiigi force-pushed the dockerfile-timestamps branch from 0ba3582 to 3a7a85e Compare January 10, 2019 16:46
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@tonistiigi tonistiigi force-pushed the dockerfile-timestamps branch from 3a7a85e to db3db10 Compare January 18, 2019 19:15
@tonistiigi tonistiigi merged commit c5fe22f into moby:master Jan 18, 2019
@thaJeztah thaJeztah added the area/feature-parity Feature parity with classic builder label Jul 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/feature-parity Feature parity with classic builder

Projects

None yet

Development

Successfully merging this pull request may close these issues.

buildkit layers created time 292 years ago

4 participants