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

[v0.12 backport] replace dockerfile/dockerignore with patternmatcher/ignorefile #4170

Closed

Conversation

thaJeztah
Copy link
Member

thaJeztah and others added 6 commits August 23, 2023 19:24
- don't use a temp-file for the test as all we need is a reader
- use a const and string-literal for the test-content, which makes it
  slightly more readable
- don't use hard-coded tests for each line, but use an "expected" slice
- don't fail early if line-numbers don't match

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 01b25b1)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Use "doc links" where possible, and better describe the function.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d116081)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
While this function would usually be used for read a `.dockerignore` file,
it accepts a Reader and can also be used to handle ignore patterns from
other files (e.g. `Dockerfile.dockerignore`) or other sources. The error
was also wrapped multiple times in some code-paths, which could lead to
an error being formatted as:

    failed to parse dockerignore: error reading .dockerignore: <some error>

Let's remove mention of the `.dockerignore` filename from the error, and
leave it to the caller to include the filename.

This patch also brings the  MainContext dockerignore error inline with the
NamedContext dockerignore error, now printing the exact name of the file.

Co-authored-by: Justin Chadwell <me@jedevc.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7eb2cea)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- integrate frontend/dockerfile/dockerignore from buildkit

full diff: moby/patternmatcher@v0.5.0...v0.6.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9f013f4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The BuildKit dockerignore package was integrated in the patternmatcher
repository / module. This patch updates our uses of the BuildKit package
with its new location.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit cb63b9c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This package was moved to github.com/moby/patternmatcher/ignorefile.
Mark the alias as deprecated.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 376e9c8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added this to the v0.12.2 milestone Aug 23, 2023
@thaJeztah thaJeztah changed the title [0.12 backport] replace dockerfile/dockerignore with patternmatcher/ignorefile [v0.12 backport] replace dockerfile/dockerignore with patternmatcher/ignorefile Aug 23, 2023
@thaJeztah thaJeztah marked this pull request as ready for review August 25, 2023 19:28
@jedevc jedevc modified the milestones: v0.12.2, v0.12.3 Aug 30, 2023
@crazy-max crazy-max modified the milestones: v0.12.3, v0.12.4 Oct 21, 2023
@crazy-max crazy-max removed this from the v0.12.4 milestone Jan 22, 2024
@crazy-max crazy-max closed this Nov 19, 2024
@thaJeztah thaJeztah deleted the 0.12_backport_migrate_dockerignore branch November 19, 2024 18:09
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.

3 participants