-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Dockerfile detector will only check files containing "Dockerfile" in the name #3499
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -288,9 +288,12 @@ func detectBuilders(enableJibInit, enableBuildpackInit bool, path string) ([]Ini | |
} | ||
|
||
// Check for Dockerfile | ||
if docker.Validate(path) { | ||
results := []InitBuilder{docker.ArtifactConfig{File: path}} | ||
return results, true | ||
base := filepath.Base(path) | ||
if strings.Contains(base, "Dockerfile") { | ||
if docker.Validate(path) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could also check in WDYT @dgageot There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think that Dockerfile validator should be aware of python-ish code constructs. |
||
results := []InitBuilder{docker.ArtifactConfig{File: path}} | ||
return results, true | ||
} | ||
} | ||
|
||
// TODO: Remove backwards compatibility if statement (not entire block) | ||
|
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.
FWIW, I've also seen a lot of
*.dockerfile
out thereThere 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.
so, it would be better to make it case insensitive?
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.
I've made it case insensitive and updated test to cover this case.