-
Notifications
You must be signed in to change notification settings - Fork 787
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
WIP: commit: optionally create layers for ADD/COPY/RUN/WORKDIR #2547
Conversation
What happens if I have
|
That doesn't work right. Moving this to a draft PR. |
@nalind: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@nalind: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@nalind Any movement on this one? Needs a rebase. |
@nalind Maybe we should just get this merged since it closes one of the cases. Then we can continue to work on the corner cases. |
49a35fb
to
5ec97be
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nalind The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retitle commit: optionally create layers for ADD/COPY/RUN/WORKDIR |
I expect conformance tests to fail on overlay because resetting the contents of a directory causes us to mark it as opaque until #2756 changes how we do things for those cases. |
A friendly reminder that this PR had no activity for 30 days. |
@nalind Is this still being worked on or can we close it? |
We still need this. |
@nalind can you rebase and repush? |
A friendly reminder that this PR had no activity for 30 days. |
@nalind rebase and repush. |
5ec97be
to
ea6310c
Compare
Change our strategy for creating layers from: * Always create layers for ADD, COPY, and RUN to: * Create layers for ADD, COPY, RUN, and WORKDIR if they made changes to the filesystem. This includes creating the WORKDIR directory if it doesn't already exist. It's often a subtle difference, but it fixes cases where a WORKDIR instruction wasn't followed by RUN, so we didn't end up accidentally creating it ourselves. We're not perfect here, because our RUN creates targets for bind mounts that `docker build` avoids, but we're closer than we were before. Signed-off-by: Nalin Dahyabhai <[email protected]>
ea6310c
to
fc0670d
Compare
@nalind: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@nalind this oldy-but-goody PR needs a rebase. |
A friendly reminder that this PR had no activity for 30 days. |
@nalind what is going on with this PR? |
A simple rebase isn't going to be enough here - it didn't pass all of the tests before it needed that. Re-adding the WIP label. |
A friendly reminder that this PR had no activity for 30 days. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
In multi-layer mode, only add layers when ADD, COPY, RUN, or WORKDIR make changes to the container's rootfs.
How to verify it
Building an image using
--layers=true
and a Dockerfile containingshould produce an image with two layers, rather than just the base image's single layer.
Conformance tests have been extended to compare how many layers we generate in comparison to
docker build
, though it makes exceptions for items we create as targets for bind mounts when handling RUN instructions.Which issue(s) this PR fixes:
Fixes #2402
Special notes for your reviewer:
The
workdir-in-image-owner
andworkdir-not-in-image
conformance tests should exercise this.Does this PR introduce a user-facing change?