Skip to content

Commit

Permalink
MAINTAINER is deprecated so warn on it or fail in pedantic mode
Browse files Browse the repository at this point in the history
fixes #56
  • Loading branch information
rnagy committed Sep 5, 2018
1 parent b07022d commit 27c5baf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM node:4-alpine

MAINTAINER Red Cool Beans <[email protected]>
LABEL maintainer="Red Cool Beans <[email protected]>"

RUN npm install -g dockerlint \
&& npm cache clean
Expand Down
14 changes: 13 additions & 1 deletion src/checks.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ exports.all = [
'label_no_empty_value',
'variable_use',
'no_trailing_spaces',
'unknown_instruction'
'unknown_instruction',
'maintainer_deprecated'
]

# Match $VAR, ${VAR}, and ${VAR:-default}
Expand Down Expand Up @@ -412,3 +413,14 @@ exports.unknown_instruction = (rules) ->
utils.log 'ERROR', "Empty / bogus instruction is invalid on line #{rule.line}"
return 'failed'
return 'ok'

# https://docs.docker.com/engine/reference/builder/#maintainer-deprecated
# Reports: WARN
exports.maintainer_deprecated = (rules) ->
ms = this.getAll('MAINTAINER', rules)
if ms.length > 0
for m in ms
utils.log exports.pedantic_severity, "MAINTAINER instruction is deprecated on line #{m.line}"
return exports.pedantic_ret

return 'ok'

0 comments on commit 27c5baf

Please sign in to comment.