Put your docker images on a diet
When running docker images you’ll see the following, images weighting several hundred of MBs. Even simple container, providing one singe service are heavy. Why ? Because base images used, such as Ubuntu, Centos and Debian images are themselves very heavy.
Images based on busybox could have been an alternative, but is too far from full-featured linux OSes, we’re used to. And building images from busybox aren’t straighforward, and often requires compilation from source.
Let me introduce Alpine linux, a lightweight Linux distribution. Alpine linux popularity is increasing among the docker community. Once discovered, people are rebasing their Dockerfile with it, and are amazed how simple the switch was. I started using Alpine long before it became official on DockerHub and started creating my own php/nginx/mariadb/container, instead of using the heavy official ones.
Originally published at h4md1.fr.