Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-8576

Update Dockerfile to Follow Docker Best Practices

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • MiNiFi
    • 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.

      See: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#minimize-the-number-of-layers

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Sethi Seth Falco
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 10m
                1h 10m