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

build: ensure empty build/rpms directory is included in build context #2784

Conversation

markusboehme
Copy link
Member

Issue number:

Closes #2783

Description of changes:

Whether intentionally or not, Docker 23 subtly changed the handling of negated patterns in .dockerignore files. In our case,

/build/*
!/build/rpms/*.rpm

will not include build/rpms in the build context with Docker 23 if the build/rpms is empty. This breaks the build since the directory is expected to exist in any case.

Add a couple extra patterns that amount to the desired behavior, whether run with Docker 23 or prior versions.

Testing done: Ran builds with Docker 20 and 23, with RPMs from prior builds in build/rpms after running cargo make clean to remove them. All builds succeeded.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Whether intentionally or not, Docker 23 subtly changed the handling of
negated patterns in `.dockerignore` files. In our case,

    /build/*
    !/build/rpms/*.rpm

will not include `build/rpms` in the build context with Docker 23 if
the `build/rpms` is empty. This breaks the build since the directory is
expected to exist in any case.

Add a couple extra patterns that amount to the desired behavior, whether
run with Docker 23 or prior versions.

Signed-off-by: Markus Boehme <[email protected]>
@markusboehme markusboehme reopened this Feb 7, 2023
@markusboehme markusboehme merged commit 62a7e47 into bottlerocket-os:develop Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build fails with "Directory /host/build/rpms must exist" after upgrading to Docker 23
3 participants