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
c8d: Fix building Dockerfiles that have FROM scratch
#46284
c8d: Fix building Dockerfiles that have FROM scratch
#46284
Conversation
LOL, wondering now if we can somehow skip the
(not something new, so not for this PR; looks like the same is the case without containerd-integration) |
90566c1
to
1cc0069
Compare
If the diff is empty and don't produce an empty layer. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This allows the legacy builder to apply changes to the `FROM scratch` layer. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
If the lease doesn't exit (for example when creating the container failed), just ignore the not found error. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
1cc0069
to
bedcc94
Compare
@@ -224,6 +224,25 @@ func ApplyUncompressedLayer(dest string, layer io.Reader, options *TarOptions) ( | |||
return applyLayerHandler(dest, layer, options, false) | |||
} | |||
|
|||
// IsEmpty checks if the tar archive is empty (doesn't contain any entries). | |||
func IsEmpty(rd io.Reader) (bool, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And now I'm wondering; could we still detect this using "Ye olde sha" of the empty tar?
Goodbye '511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158',
it was nice knowing you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a fast path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^^ for future reference; this was reverted; it turned out that there was no canonical digest for "empty archive", and the code below was not "too heavy", so it wouldn't gain us much.
8a2ec67
to
bedcc94
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
FROM scratch
#46248DOCKER_BUILDKIT=0
docker/for-mac#6853 (comment)- What I did
Fix running containers with empty
Image
.- How I did it
See commits.
- How to verify it
c8d integration tests (#45232) from
TestDockerCLIBuildSuite
:Before
After
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)