hadolint
介紹
安裝
$ brew install hadolint$ docker run --rm -i ghcr.io/hadolint/hadolint < DockerfileFROM centos:7 MAINTAINER jack RUN yum install -y wget RUN cd / ADD jdk-8u152-linux-x64.tar.gz / RUN wget http://apache.stu.edu.tw/tomcat/tomcat-7/v7.0.82/bin/apache-tomcat-7.0.82.tar.gz RUN tar zxvf apache-tomcat-7.0.82.tar.gz ENV JAVA_HOME=/jdk1.8.0_152 ENV PATH=$PATH:/jdk1.8.0_152/bin CMD ["/apache-tomcat-7.0.82/bin/catalina.sh", "run"]$ docker run --rm -i ghcr.io/hadolint/hadolint < Dockerfile -:2 DL4000 error: MAINTAINER is deprecated -:4 DL3032 warning: `yum clean all` missing after yum command. -:4 DL3033 warning: Specify version with `yum install -y <package>-<version>`. -:6 DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation. -:6 DL3003 warning: Use WORKDIR to switch to a directory -:10 DL3047 info: Avoid use of wget without progress bar. Use `wget --progress=dot:giga <url>`. Or consider using `-q` or `-nv` (shorthands for `--quiet` or `--no-verbose`). -:11 DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.
FROM python MAINTAINER johndoe@gmail.com LABEL org.website="containiq.com" RUN mkdir app && cd app COPY requirements.txt ./ RUN pip install --upgrade pip RUN pip install -r requirements.txt COPY . . CMD python manage.py runserver 0.0.0.0:80000$ docker run --rm -i ghcr.io/hadolint/hadolint < Dockerfile -:1 DL3006 warning: Always tag the version of an image explicitly -:2 DL4000 error: MAINTAINER is deprecated -:5 DL3003 warning: Use WORKDIR to switch to a directory -:5 SC2164 warning: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. -:7 DL3045 warning: `COPY` to a relative destination without `WORKDIR` set. -:8 DL3013 warning: Pin versions in pip. Instead of `pip install <package>` use `pip install <package>==<version>` or `pip install --requirement <requirements file>` -:8 DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>` -:9 DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation. -:9 DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>` -:11 DL3045 warning: `COPY` to a relative destination without `WORKDIR` set. -:13 DL3025 warning: Use arguments JSON notation for CMD and ENTRYPOINT arguments
規則
Rule
Default Severity
Description
忽略規則
vscode 外掛套件
Last updated



