Repolode
slimtoolkit

slimtoolkit/slim

SlimToolkit (Slim) inspects, minifies and hardens existing container images without changing your Dockerfile or workflow.

Stars
23,477
Forks
851
Open issues
213
Last commit
last month

What is it?

Slim is a command-line toolkit for container images. It analyzes a running application inside a temporary container, keeps only the files the application needs, and produces a smaller image. The README reports minification of up to 30x for many interpreted-language images, and even larger reductions for compiled Go images. The original image's base OS, package manager and build process stay in place.

Beyond minification, Slim generates Seccomp and AppArmor security profiles from observed application behavior, which reduces the attack surface of the resulting container. Its subcommands cover xray (inspecting image layers and reverse engineering the Dockerfile), lint, build, debug (attaching a debugging sidecar to a minified container), run, merge, registry operations and vulnerability lookups.

Slim is written in Go, licensed under Apache-2.0, and distributed as binaries, a Homebrew formula and a Docker image. It has been used with Node.js, Python, Ruby, Java, Go, Rust, Elixir and PHP apps on Ubuntu, Debian, CentOS, Alpine and Distroless bases.

Key features

  • 01Minifies container images by analyzing the running application, without requiring Dockerfile changes.
  • 02Generates Seccomp and AppArmor security profiles automatically.
  • 03Inspects image layers and reverse engineers the Dockerfile with the xray command.
  • 04Lints Dockerfiles with the lint command.
  • 05Provides a debug sidecar workflow for troubleshooting minified containers.
  • 06Supports registry operations, image merging and vulnerability lookups.

Use cases

  • Reducing the size of production images for Node.js, Python, Ruby or Go services.
  • Hardening containers by restricting syscalls with auto-generated Seccomp profiles.
  • Inspecting unfamiliar images to see what files they contain and how they were built.
  • Packaging dockerized command-line tools into small, single-purpose images.

Quick start

  1. 1

    Download the zip or tar.gz package for your platform from the README links

    curl -L -o ds.tar.gz https://github.com/slimtoolkit/slim/releases/download/1.40.11/dist_linux.tar.gz
  2. 2

    Extract the package

    tar -xvf ds.tar.gz
  3. 3

    Move the slim binary into your bin directory

    mv dist_linux/slim /usr/local/bin/
  4. 4

    Minify an image by building a slim version of it from the README example

    slim build --target archlinux:latest --tag archlinux:curl --http-probe=false --exec "curl checkip.amazonaws.com"

Things to know

  • Some application stacks need extra probing flags or --include-path to capture dynamically loaded files.
  • Analysis works by running a temporary container, so Docker must be available.

In collections

Topics

FAQ

What is slim?
SlimToolkit (Slim) inspects, minifies and hardens existing container images without changing your Dockerfile or workflow. Slim is a command-line toolkit for container images. It analyzes a running application inside a temporary container, keeps only the files the application needs, and produces a smaller image. The README reports minification of up to 30x for many interpreted-language images, and even larger reductions for compiled Go images. The original image's base OS, package manager and build process stay in place.
Is slim free to use? What license does it have?
slim is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is slim still maintained?
Updated within 6 months. The last commit to slim was on Sep 19, 2026.
What can I use slim for?
Reducing the size of production images for Node.js, Python, Ruby or Go services. Hardening containers by restricting syscalls with auto-generated Seccomp profiles. Inspecting unfamiliar images to see what files they contain and how they were built. Packaging dockerized command-line tools into small, single-purpose images.
How do I install slim?
Download the zip or tar.gz package for your platform from the README links: curl -L -o ds.tar.gz https://github.com/slimtoolkit/slim/releases/download/1.40.11/dist_linux.tar.gz Extract the package: tar -xvf ds.tar.gz Move the slim binary into your bin directory: mv dist_linux/slim /usr/local/bin/ Minify an image by building a slim version of it from the README example: slim build --target archlinux:latest --tag archlinux:curl --http-probe=false --exec "curl checkip.amazonaws.com"
Where can I get slim?
The source code and installation instructions are on GitHub: https://github.com/slimtoolkit/slim

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects