You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2020/10/09 09:30:13 UTC

[GitHub] [accumulo-docker] SethiPandi opened a new pull request #14: Update Dockerfile to follow some of the best practices.

SethiPandi opened a new pull request #14:
URL: https://github.com/apache/accumulo-docker/pull/14


   The Dockerfile for this had a few issues which bloated the size of the image, and how many layers it had.
   
   This does not follow _all_ practices from the [Dockerfile Best Practices](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/), but just a few easy adjustments that should be risk free from breaking anything.
   
   In an ideal world, this should be a multistage build that separate the build from the runtime, so that the final image doesn't include any development tools like JDK/gcc or utilities like wget; reducing the size of the image further and reducing the attack surface from third-parties.
   
   The original image before this PR was 2.91 GB, it's now 1.96 GB.
   
   ### Minimizing Layers
   Every instance of `RUN`, `ADD`, and `COPY` creates a new `layer` in a Docker image and creates a new intermediate image.
   For this reason, it's best to minimize the number of these in a Dockerfile. This will both speed up the build process of the image itself, but also reduce the size of it.
   
   * I've merged all `RUN` statements into one.
   * I've moved all the `.properties` files into a directory so that the contents of the directory can be moved in a single `ADD` statement instead of separate ones.
   
   See: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#minimize-the-number-of-layers
   
   ### Ignoring Files
   This one very minor for a repo like this, but it can speed up the build and reduce the size to exclude files from the build context if they're not needed there. Due to the size of the repo, the difference this makes is negligible; but I added one anyway to exclude what I think isn't required.
   
   See: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#exclude-with-dockerignore


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [accumulo-docker] ctubbsii commented on pull request #14: Update Dockerfile to follow some of the best practices.

Posted by GitBox <gi...@apache.org>.
ctubbsii commented on pull request #14:
URL: https://github.com/apache/accumulo-docker/pull/14#issuecomment-706349857


   Thanks for the PR @SethiPandi . If you wish to be added as a contributor to https://accumulo.apache.org/people/ , please open a pull request to add yourself at https://github.com/apache/accumulo-website/edit/main/pages/people.md and leave a reference to `apache/accumulo-docker#14` in your commit log.
   
   If you intend to be a regular contributor to Accumulo projects, please consider subscribing to our developer mailing list (https://accumulo.apache.org/contact-us/) and introducing yourself. :smiley_cat:


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [accumulo-docker] ctubbsii merged pull request #14: Update Dockerfile to follow some of the best practices.

Posted by GitBox <gi...@apache.org>.
ctubbsii merged pull request #14:
URL: https://github.com/apache/accumulo-docker/pull/14


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org