[Hawkular-dev] Docker image size does matter

Jiri Kremser jkremser at redhat.com
Wed Feb 1 06:29:32 EST 2017


Hello,
  I was looking into google/cadvisor docker image that is only 47 megs
large and wondering how we can improve. To some extend it is so small
because of the Go lang, but not only.

Here are the results:

base image with JRE 8 and Alpine linux: 76.8 MB
wildfly 10.1.0.Final image 215 MB
hawkular-services 320 MB

Just for the record, here is status quo:
base CentOS image w/ JDK 8: 149 MB
wf image: 580 MB
hawkular-services image  672 MB

All the mini-images are based on Alpine (that itself is based on BusyBox),
so the price for it is less convenience when debugging the images.

I also removed
9.2M  /opt/jboss/wildfly/docs

and wanted to remove
9.0M  /opt/jboss/wildfly/modules/system/layers/base/org/hibernate
5.1M  /opt/jboss/wildfly/modules/system/layers/base/org/apache/lucene
5.6M  /opt/jboss/wildfly/modules/system/layers/base/org/apache/cxf

but from some reason the h-services fails to start because it didn't found
some class from that hibernate module, so I rather put it back.

What also helped was squashing all the image layers into 1. This makes the
download faster and possibly the image smaller. When applying docker-squash
[1] to the current h-services image it saves ~50megs

I am aware that this probably wont fly with some RH policy that we should
base our SW on Fedora/RHEL base OS images, but I am gonna use them for
development and because I often run out of space because of Docker.

Oh and I haven't published it on dockerhub yet, but the repo is here [2]

jk


[1]: https://github.com/goldmann/docker-squash
[2]: https://github.com/Jiri-Kremser/hawkular-services-mini-dockerfiles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hawkular-dev/attachments/20170201/73e33cb5/attachment.html 


More information about the hawkular-dev mailing list