Comments (12)
Stumbled on this issue, and would urge you to reconsider. With wider use of a linter, there will always be issues that cause false-positives, and waiting for a patch/fix/release upstream is not always an option for users.
Most linters I'm familiar with will have an 'escape' comment that suppresses either all, or a specific, warning (# NOQA
, // NOLINT(rule)
, etc.)
from dockerlint.
Closing the initial ticket as the point of linting is not to have a way around issues.
from dockerlint.
You're looking for something like the Lint style comments like /* NOTREACHED */
, right?
from dockerlint.
yeah.
from dockerlint.
Actually, I wonder why Dockerlint is warning as the check has this comment:
# Although ADD and COPY are functionally similar, generally speaking, COPY is preferred.
# The only/best use for ADD is to add-and-extract archives to an image.
# Reports: WARN
So I wonder why it's complaining for you when you use ADD
with a tarball. Could you please show the offending line from your Dockerfile?
from dockerlint.
https://github.com/mcandre/docker-gentoo/blob/master/Dockerfile#L4
from dockerlint.
I don't see any problems in linting your Dockerfile
:
DEBUG:[ { line: 1, instruction: 'FROM', arguments: [ 'scratch' ] },
{ line: 2,
instruction: 'MAINTAINER',
arguments: [ 'Andrew Pennebaker <[email protected]>' ] },
{ line: 3, instruction: 'COPY', arguments: [ 'tar /tar' ] },
{ line: 4,
instruction: 'ADD',
arguments: [ 'stage3-amd64-20150604.tar.bz2 /' ] },
{ line: 5,
instruction: 'RUN',
arguments:
[ 'echo \'default\' > /run/openrc/softlevel &&',
'sed -e \'s/#rc_sys=""/rc_sys="lxc"/g\' -i /etc/rc.conf &&',
'ln -s /etc/init.d/net.lo /run/openrc/started/net.lo &&',
'ln -s /etc/init.d/net.lo /etc/init.d/net.eth0 &&',
'ln -s /etc/init.d/net.eth0 /run/openrc/started/net.eth0 &&',
'echo \'UTC\' > /etc/timezone &&',
'mkdir -p /usr/portage/{distfiles,metadata,packages} &&',
'chown -R portage:portage /usr/portage &&',
'echo \'masters = gentoo\' > /usr/portage/metadata/layout.conf &&',
'emerge-webrsync &&',
'eselect news read new &&',
'env-update' ] } ]
INFO: Dockerfile.mcandre is OK.
There is a specific check in the code to allow ADD
for archives, such as the .tar.bz2
extension.
from dockerlint.
I seem to have a false positive as well.
ENV INSTALL_DIR /opt/foo/bar
WORKDIR $INSTALL_DIR // WORKDIR path $INSTALL_DIR must be absolute
An ignore comment would be really useful.
from dockerlint.
+1
from dockerlint.
@dalejefferson that has been fixed in 1fa5bfe
from dockerlint.
This would be nice to have because of issue 9.
from dockerlint.
Closing the initial ticket as the point of linting is not to have a way around issues.
Holy bananas that's a bit of a strong position to take. I'd assert that things have changed since 2017, and that all major linters (ESLint, etc) support disabling rules, lines, blocks, etc. Sometimes you want to willingly disable the linter for any number of reasons.
Linters are supposed to be opinionated by default, but configurable.
from dockerlint.
Related Issues (20)
- Regression: incorrectly claimed error "RUN contains undefined ARG or ENV variable"
- No warning for error "ENV must have two arguments" HOT 1
- undefined ARG or ENV variable when using variables from base image HOT 6
- Comments not parsed correctly if at beginning of file
- No warning for error "ENV must have two arguments" HOT 1
- RUN contains undefined ARG or ENV variable for a very defined ARG variable HOT 5
- should not require WORKDIR to be absolute path HOT 1
- Possible false positive for comments within a run command. HOT 1
- ERROR: ENV invalid format when ENV followed with `\`
- MAINTAINER instruction is deprecated
- ENV invalid when environment variable contains excaped $ HOT 1
- Repo Maintenance HOT 2
- Recurse over directories
- Linter does not follow ESCAPE directive
- Incorrect ARG warning in multistage dockerfile
- Same for docker-compose
- Trailing Spaces Error on Commented Lines
- dockerlint incorrectly alerts on any commands included within a RUN<<HEREDOC stanza
- Separate entrypoints in a multi-stage build are marked erroneously as an error
- Please release 0.3.10 and 0.3.11 to npm
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dockerlint.