Giter Club home page Giter Club logo

Comments (12)

paulbovbel avatar paulbovbel commented on August 19, 2024 6

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.

rnagy avatar rnagy commented on August 19, 2024 4

Closing the initial ticket as the point of linting is not to have a way around issues.

from dockerlint.

jasperla avatar jasperla commented on August 19, 2024

You're looking for something like the Lint style comments like /* NOTREACHED */ , right?

from dockerlint.

mcandre avatar mcandre commented on August 19, 2024

yeah.

from dockerlint.

jasperla avatar jasperla commented on August 19, 2024

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.

mcandre avatar mcandre commented on August 19, 2024

https://github.com/mcandre/docker-gentoo/blob/master/Dockerfile#L4

from dockerlint.

jasperla avatar jasperla commented on August 19, 2024

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.

DaleLJefferson avatar DaleLJefferson commented on August 19, 2024

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.

benjamine avatar benjamine commented on August 19, 2024

+1

from dockerlint.

rnagy avatar rnagy commented on August 19, 2024

@dalejefferson that has been fixed in 1fa5bfe

from dockerlint.

dmikalova avatar dmikalova commented on August 19, 2024

This would be nice to have because of issue 9.

from dockerlint.

shellscape avatar shellscape commented on August 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.