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

dockerfile: add lint rule for maintainer instruction #4878

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

jsternberg
Copy link
Collaborator

No description provided.

@jsternberg jsternberg force-pushed the maintainer-lint-rule branch 2 times, most recently from 98ddfb6 to 3197f85 Compare April 24, 2024 21:12
Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

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

Check CI errors

@@ -80,6 +80,9 @@ func ParseInstructionWithLinter(node *parser.Node, lintWarn linter.LintWarnFunc)
case command.Env:
return parseEnv(req)
case command.Maintainer:
if lintWarn != nil {
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we could just have this nil check inside the Run() one time so every caller does not need to check it.

@@ -41,4 +41,12 @@ var (
return fmt.Sprintf("Command '%s' should match the case of the command majority (%s)", violatingCommand, correctCasing)
},
}
RuleMaintainerDeprecated = LinterRule[func() string]{
Name: "MaintainerDeprecated",
Description: "The maintainer instruction is deprecated and will generate an error in future versions of the Dockerfile syntax",
Copy link
Member

Choose a reason for hiding this comment

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

nit: Because we can't actually remove instructions without v2, maybe "The maintainer instruction is deprecated, use a label instead to define image author."

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
@tonistiigi tonistiigi merged commit 03a2b91 into moby:master Apr 25, 2024
74 checks passed
@jsternberg jsternberg deleted the maintainer-lint-rule branch July 10, 2024 16:35
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.

None yet

4 participants