MAX-Object-Detector icon indicating copy to clipboard operation
MAX-Object-Detector copied to clipboard

Dockerfile doesn't pass linting using hadolint

Open csantanapr opened this issue 3 years ago • 3 comments

We are working on creating Tekton Pipelines for the application.

One of the Tekton tasks link the Dockerfile using hadolint

Here are the findings in the task that should be fixed or ignore via comment in Dockerfile

Dockerfile:19 DL3004 error: Do not use sudo as it leads to unpredictable behavior. Use a tool like gosu to enforce root
Dockerfile:33 DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.
Dockerfile:33 DL4006 warning: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check
Dockerfile:36 DL3045 warning: `COPY` to a relative destination without `WORKDIR` set.
Dockerfile:37 DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>`
Dockerfile:39 DL3045 warning: `COPY` to a relative destination without `WORKDIR` set.
Dockerfile:44 SC1075 error: Use 'elif' instead of 'else if' (or put 'if' on new line if nesting).
Dockerfile:44 DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.
Dockerfile:56 DL3025 warning: Use arguments JSON notation for CMD and ENTRYPOINT arguments

csantanapr avatar Apr 26 '21 22:04 csantanapr

FYI: I am working with @csantanapr in this experiment

SSaishruthi avatar Apr 26 '21 23:04 SSaishruthi

Maybe some of those warnings should be fixed?

For example: Dockerfile:37 DL3042 warning: Avoid use of cache directory with pip. Use pip install --no-cache-dir ` this could reduce the size of the image

bdwyer2 avatar Apr 27 '21 15:04 bdwyer2

Could you try again with the latest version?

xuhdev avatar Sep 24 '21 04:09 xuhdev