How to Make Docker Images Smaller: Introduction

By richardtylee

Docker has become very popular in the last few years.  At work, we've been using it for over a year now.  As we develop, images for our apps are becoming very large. This is becoming an issue because building, pulling and pushing these images are taking longer and longer. Furthermore, our deployment process has been intermittently failing when doing docker push to Docker Hub; this happens particularly often when upstream internet is slow. Our team tried a handful of different techniques to shrink our image sizes.

This week, I'll go over the different techniques to shrink Docker images. We'll look at the advantages and disadvantages.  Depending on your engineering organization and architecture, some will worker better than others.

  1. Base OS Images
  2. Ruby and Rails Images
  3. Docker Squash
  4. App Code Separation