Hi,

Currently we don't have a base image for WSO2 Docker images due to image
size issues we had with it. But later we found out that this was mainly due
to multiple RUN commands, which caused Docker to add unnecessary layers.

I think we should bring back the base image for couple of reasons;

1. wso2base image with minimum packages installed (wget, puppet etc) will
eliminate the need for having to run apt-get commands (which are very
expensive, time-wise) each and every time

2. wso2base image can be hosted publicly (without Oracle JDK of course) so
that users don't have to build wso2base but rather pull it from DockerHub.

3. wso2base image provides a Docker layer which reduces the amount of
traffic carried when pulling images from a Docker registry over a long
period of time. This is because base image is very unlikely to be changed,
but product images can change very rapidly (due to artifacts or
configuration change, product version etc.). It is unnecessary to carry the
information in the lower level layers each time a product image is changed.

If you must use a single image, I found this cool Docker tool written in
Python which can be used to squash Docker layers called docker-squash [1].
Following is a comparison of Docker images built with/without wso2base and
squashed images;

[image: Inline image 3]

In summary;
wso2am-1.10.0 with base image: 1.079GB
wso2am-1.10.0 with base image and *squashed*: 948MB
wso2am-1.10.0 *without* base image: 969MB

wso2esb-4.9.0 with base image: 794MB
wso2esb-4.9.0 with base image and *squashed*: 664MB
wso2esb-4.9.0 *without* base image: 685MB

In conclusion, introducing a base image with minimum packages has a image
size overhead of around 100+MB, but having individual images without a
hierarchy can cause a significant amount of unnecessary information being
transferred over the network when pull/push'ing to/from a registry.

I've created a PR for this feature at [2]. Also used
"--no-install-recommends" option to apt-get when installing packages to
prevent unnecessary packages being installed. Please share your thoughts.

[1] https://github.com/goldmann/docker-squash
[2] https://github.com/wso2/dockerfiles/pull/46/files

Thanks.
-- 
Akila Ravihansa Perera
WSO2 Inc.;  http://wso2.com/

Blog: http://ravihansa3000.blogspot.com
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to