Multiple improvements for Dockerfile
There are multiple issues in the used Dockerfile, so I suggest a small refactor/change for fixing:
-
Fix #103 (closed) -
Fix #102 (closed) -
Missing WORKDIR instruction (default working directory inside the container currently is / ) -
Use COPY instead of ADD - local directory is used which is not archive or remote url
-
Add CMD command with default --help arg - diffoscope invocation without params return "error: the following arguments are required: path1" with exit code 2, using default --help arg will return 0 exit code and the help text without error.
-
Copy only required files during deps install to avoid cache busts. -
Remove dist-upgrade - docker documentation say to avoid it & it might not work at all https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#apt-get
-
Merge RUN commands to reduce number of layers inside the image -
Fix "Use of apt-get update should be paired with rm -rf /var/lib/apt/lists/* in the same layer." -
Dockerfile lint tools return zero (or accepted minimum) results -
Missing LABEL org.opencontainers.image.* entries
Will work on it in upcoming week and post a example of fixed Dockerfile as comment in this issue :)
Edited by Chris Lamb