Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize image size #9

Open
davidonlaptop opened this issue Feb 21, 2015 · 2 comments
Open

Optimize image size #9

davidonlaptop opened this issue Feb 21, 2015 · 2 comments

Comments

@davidonlaptop
Copy link
Member

Currently the adam and avocado images takes up to 1GB of disk space. It can be a pain to download an entire 1GB just to get a new feature of a few dozens lines of code...

There is good chances that 50% of this space can be spared by cleaning up after the build (e.g. maven artifacts, temporary files, etc).

E.g. we could use one docker container with maven to build an adam jar, and put the jar into another (smaller) container with java only.

@davidonlaptop
Copy link
Member Author

Using a .dockerignore file could be of great help in reducing the final image size.

@frol
Copy link

frol commented Mar 20, 2015

Here are some points to keep an image as small as possible:

  1. Use minimal base object (i.e. Alpine, which is 5MB!, or at least Debian instead of Ubuntu)
  2. Use RUN command as less as possible - combine several actions into one by using && (here is a good example (though there should be also rm /var/cache/apt/archive/*): https://registry.hub.docker.com/u/gelog/java/dockerfile/ (why that image is way better then images in tis repo?))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants