Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
The Dockerfiles in the repository could use a fair bit of tidying up.
The biggest issue is that there are so many layers being created in the Dockerfiles.
These make image build times huge and increased the final size of the image substantially.
For example, building `minify-docker/dockerhub/Dockerfile` currently creates a 236 MB image.
By just grouping the `RUN` commands together, this can be reduced to 161 MB,
because we've reduced the total number of layers of the image.
Also, the `MAINTAINER` keyword was deprecated back in 2017.
This should be a `LABEL` called `maintainer` instead.
See: https://docs.docker.com/engine/deprecated/#maintainer-in-dockerfile
Finally, some the `ADD` keyword can be put above `RUN`, and the `mkdir` commands
removed, since the directory and any parent directories are automatically
created by Docker by performing the `ADD/COPY/WORKDIR` commands.