Reducing Docker Image Size - Slimming vs Compressing

Pieter van Nordennen
← Slim Blog

We often get questions about the difference between compressing images and slimming images. Both are critical to having a happy and efficient development pipeline, but understanding the difference between them is important to have a high-performing and secure cloud-development process.

  • Compressing is simply the act of making an image smaller, like zipping a file.
  • Slimming is the process of optimizing your image so that it is performant, secure, and usable in all stages of the SDLC.

Compressing an image is a simple, automated, and basic task that can be handled at all stages of the CI/CD pipeline. The Docker executable even does this for you by default by producing a tarball of your container. Compressed images don’t run; their primary function is to move smoothly through the pipeline and reduce transfer costs and disk space.

When we talk about slimming images, we’re talking about a system of tools and techniques to optimize an image. Slimming an image results in a container that has only the code it needs to run and nothing more. This leads to better outcomes across all phases of development. This process is often manual and requires specialized knowledge.

Slimming an image also reduces the container size, but is a dynamic and use-case specific process. You may have a different slimmed image in your development environment than you do in staging or production.

Slim images are faster, more performant, and safer, as the act of slimming an image reduces the attack surface of a container. Slimmed images can also be compressed, usually with the same compression ratios of non-slimmed images.

Most developers today don’t know, and don’t have time to learn, how to dissect their Docker images, make smart optimizations, and get the right tooling to ship their containers safely and effectively.

At Slim.AI, we’re working on tools that automate the process of slimming and optimizing images. Interested in learning more? Check out the example library in our SlimToolkit (previously DockerSlim) open source project, or shoot us an email at to request a beta invite.

Make security collaboration easier today

Join the waitlist to try out Slim's shared workspace for communicating and coordinating vulnerability fixes with your software vendors.
Responsive HubSpot Form

Join our Beta

Take the complexity and frustration out of coordinating vulnerability fixes with your vendors.

  • Communicate directly in the platform to assign owners, due dates and negotiate fixes
  • Get a view into the status of each vulnerability
  • Receive notifications the moment vulnerabilities are fixed

Additionally, our Beta users get access to:

  • Multiple vulnerability scanners
  • SBOM generation
  • Reachability analysis
  • Enhanced container intelligence software
  • Dedicated Support

Join our Beta

Take the frustration out of vulnerability fixes with software vendors directly on our platform.

  • Assign owners, set due dates, track vulnerability statuses, and get instant fix notifications.
  • Beta users gain access to multiple scanners, SBOM generation, reachability analysis, enhanced container intelligence, and dedicated support.