Skip to content

Comments

Ignore *.dockerignore files as they do not conform to the Dockerfile spec#943

Merged
TylerJang27 merged 1 commit intotrunk-io:mainfrom
NellyWhads:dockerignore
Dec 30, 2024
Merged

Ignore *.dockerignore files as they do not conform to the Dockerfile spec#943
TylerJang27 merged 1 commit intotrunk-io:mainfrom
NellyWhads:dockerignore

Conversation

@NellyWhads
Copy link
Contributor

Docker supports ignore files to keep build contexts clean.

The current configuration ignores the generic .dockerignore as expected, but attempts to lint Dockerfile-specific configurations such as Dockerfile.dockerignore, test.Dockerfile.dockerignore and Dockerfile.build.dockerignore.

This PR aims to resolve this bug.

@trunk-io
Copy link

trunk-io bot commented Dec 27, 2024

⏱️ 43m total CI duration on this PR
Job Cumulative Duration Recent Runs
Linter Tests ubuntu-latest 21m 🟩
Linter Tests macOS 19m 🟩
Trunk Check runner [linux] 1m 🟩
CodeQL-Build 1m 🟩
Repo Tests / Plugin Tests 31s 🟩
Detect changed files 5s 🟩
Aggregate Test Results 1s 🟩

settingsfeedbackdocs ⋅ learn more about trunk.io

Copy link
Collaborator

@TylerJang27 TylerJang27 left a comment

Choose a reason for hiding this comment

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

Good catch! Thanks again!

@TylerJang27 TylerJang27 merged commit b2fa5ce into trunk-io:main Dec 30, 2024
13 checks passed
@NellyWhads NellyWhads deleted the dockerignore branch December 30, 2024 22:45
TylerJang27 added a commit that referenced this pull request Apr 2, 2025
TylerJang27 added a commit that referenced this pull request Apr 2, 2025
Reverts #943 and also adds an ignore to handle the original request

Fixes the error log `Error parsing
'(?i)(?:^|/)Dockerfile\.(?!.*\.dockerignore$).+$': invalid perl
operator: (?!`, since re2 doesn't support negative matches. Tested that
the log is no longer there and `trunk check query` produces the correct
LQRs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants