You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by "Syed Shah (Jira)" <ji...@apache.org> on 2020/10/07 15:24:00 UTC
[jira] [Created] (MINIFI-541) Update Dockerfile to Follow Docker
Best Practices
Syed Shah created MINIFI-541:
--------------------------------
Summary: Update Dockerfile to Follow Docker Best Practices
Key: MINIFI-541
URL: https://issues.apache.org/jira/browse/MINIFI-541
Project: Apache NiFi MiNiFi
Issue Type: Improvement
Components: Docker
Reporter: Syed Shah
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.
See: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#minimize-the-number-of-layers
Also, the of the `MAINTAINER` keyword with was deprecated back in 2017.
This should be a `LABEL` called `maintainer` instead.
See: https://docs.docker.com/engine/deprecated/#maintainer-in-dockerfile
Finally, in 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` command.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)