DockerSelf-Hosting

Slim (SlimToolkit, now Mint) with Docker: Make Your Images Much Smaller (Linux, Windows, Mac)

Before you start

  • 25 min read

Boxes marked Run in terminal are what you type; plain text explains why. Check what you need first

What you get in one minute#

Slim (formerly DockerSlim) is a free command-line tool that starts your Docker image, watches which files the app really uses, and builds a new, much smaller image from only those files. Today the maintained version is called Mint.

Slim official logo

Logo: the official Slim (SlimToolkit) project (github.com/slimtoolkit/slim, file assets/images/dslim/logo.png at tag 1.40.11, Apache-2.0)

You keep your Dockerfile and base image. Slim removes what the app never touched: package managers, compilers, docs, spare libraries. A smaller image downloads faster, uses less disk and gives an attacker less to work with. The catch: Slim only keeps what it saw. A file your app opens later, such as a template for a page nobody requested during the test, can be removed. This guide shows how to avoid that.

The name. The project was DockerSlim, then SlimToolkit (repository slimtoolkit/slim, last release 1.40.11 in February 2024). The same maintainer now publishes it as Mint (mintoolkit/mint); its README says the rename was a CNCF requirement because "Slim" was too close to a company name. New releases go to Mint: 1.41.8 on 12 December 2025. The website slimtoolkit.org and the CNCF landscape still use the old name. This guide uses Mint 1.41.8. The command is mint slim; the old slim build still works as an alias.

WhatValue (official sources, read 5 December 2026)
Current versionMint 1.41.8, released 12 December 2025. The old Slim line ended at 1.40.11 (2 February 2024)
Image to pinmintoolkit/mint:1.41.8 (amd64) or mintoolkit/mint-arm:1.41.8 (arm64), both checked on Docker Hub
Time neededAbout 30 minutes (our estimate, not measured)
SizeThe Mint image is about 26 MB compressed on Docker Hub (API size field)
PortsNone for Mint itself. It briefly publishes your app's ports on random host ports while it tests
LicenceApache-2.0
CNCFSandbox project, accepted 17 May 2023 (CNCF landscape file)
Official docsgithub.com/mintoolkit/mint

At a glance:

  • What it is: one program (mint) plus a helper (mint-sensor), or one short-lived container.
  • What it does: mint xray shows what is inside an image, mint slim builds the small image, mint lint checks a Dockerfile.
  • What it needs: a running Docker daemon and an image that starts without extra setup.
  • What can go wrong: files loaded late are dropped. Always test the new image and keep the old one.
  • Not a scanner: use Trivy or Grype and Syft for vulnerabilities, and dive to look inside an image.

How it fits together#

Mint reads your image, starts it in a temporary container with a sensor, sends it requests, records every file the app uses, and builds a new image from that list. You then test the result.

Slim and Mint flow: mint slim reads your original image, starts a temporary container where a sensor logs every file the app uses while default and custom requests exercise the app, builds the slim image from the list of files used plus your include-path entries, and you then test the slim image yourself

Drawn for this guide from the official README and the source at tag 1.41.8. The dashed step is manual: Mint never does it.

Two words: dynamic analysis means Slim learns from a running app, not from the Dockerfile. The sensor is the small helper (mint-sensor) that Mint puts into the temporary container to record file access.

Before you start#

Note: every image name, domain, password and key on this page is a dummy example (like example/app or change-me). Replace it with your own and keep real secrets out of Git.

SystemWhat to have
LinuxA 64-bit distribution, Docker Engine 25.0 or newer (see the note below), a user that can run docker ps. About 100 MB free for Mint plus space for your images
WindowsWindows 10 or later, Docker Desktop (WSL 2 backend), PowerShell. Mint runs as a container here (the project has no Windows build)
MacmacOS with Docker Desktop (or Colima), Intel or Apple Silicon, and Homebrew

Check Docker:

Run in terminalbash
docker --version
docker ps

docker ps is the real test: it proves your user can reach the Docker socket. Mint 1.41.8 talks to Docker with API version 1.44 by default (we read it in the source), and Docker Engine 25.0 is the first release that offers it, according to the Docker API version table.

Checklist:

  • [ ] docker ps works without a permission error
  • [ ] You have an image to slim, or use the sample app in Step 2
  • [ ] You can rebuild or re-pull the original image if the slim one fails

Tested on 2026-12-05: Linux = not run, Windows = not run, Mac = not run. The commands come from the official README, the release files and the source at tag 1.41.8. We did not run Mint or Docker on a real machine.

Tip: The first slim image is an experiment. Keep the original tag and switch only when your tests pass.

LLM Guide: let your AI assistant set it up#

Prefer to let an AI do the typing? Copy the block below into ChatGPT, Claude, Gemini or a local model. It first asks about your setup (system, Docker, the image you want to shrink), then follows only the path that fits you. It uses the same pinned version as this guide. You still read each command before you run it.

Instructions for your AI assistantllm
You are my assistant for shrinking a Docker image with Mint (the maintained continuation of Slim / DockerSlim).
Follow the DIY Lab Hub guide https://diylabhub.com/slim/ (checked 5 December 2026).
Work one step at a time. Before each command, say in one line what it does. Wait for my OK before anything that deletes an image or container, installs into /usr/local/bin, or touches the Docker socket.

STEP 0 - FIND OUT MY SETUP. Ask me these questions (or have me run the read-only checks) before you do anything else:
1. Which machine: Linux (which distribution, x86-64 or ARM64), Windows or Mac (Intel or Apple Silicon)?
2. Is Docker installed and can my user reach it? Check: docker --version and docker ps (Mint needs Docker Engine 25.0 or newer; the docker.sock is root-equivalent).
3. Which image do I want to slim? Is it a normal app image that starts without extra setup (not a reusable base image)? Which port does it serve, and which routes or files does it only use later (templates, static files, certificates, plugins)?
4. Or do I want to try the guide's small sample app first (example/app)?
5. Do I have a way to rebuild or re-pull the original image if the slim one fails?
Mint is a command-line tool: it opens no port and has no web page, so there is no proxy, Traefik or Caddy part. If I later publish the slimmed app, follow that app's own guide.

THEN FOLLOW THE MATCHING PATH:
- Docker missing or my user cannot run docker ps: fix that first (Docker Engine on Linux, Docker Desktop with WSL 2 on Windows, Docker Desktop or Colima on Mac).
- Linux x86-64: work in ~/docker_volumes/slim/{app,reports,backups}; MINT_VERSION=1.41.8; download https://github.com/mintoolkit/mint/releases/download/${MINT_VERSION}/dist_linux.tar.gz (ARM64: dist_linux_arm64.tar.gz and the folder dist_linux_arm64); check it with the guide's SHA-256 (1b25208157657ea8a9ec94a9aa61f2dfc087710a6d938513bbeda43cce84142c, x86-64 file only); unpack; sudo install -m 0755 dist_linux/mint dist_linux/mint-sensor /usr/local/bin/ (mint and mint-sensor must stay together); mint --version must contain 1.41.8.
- Windows (PowerShell): there is no Windows build. Run Mint from its container: docker pull mintoolkit/mint:1.41.8 and define function mint { docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock mintoolkit/mint:1.41.8 @args } in each PowerShell window (Windows on ARM: mintoolkit/mint-arm:1.41.8). Say that the project never tested WSL 2 and neither did the guide. Use curl.exe, not curl. The container cannot see my files unless I mount them (-v <folder>:/work).
- Mac: brew install mintoolkit (not docker-slim), then mint --version. If /var/run/docker.sock is missing: tick "Enable default Docker socket" in Docker Desktop, or export DOCKER_HOST=unix://$HOME/.docker/run/docker.sock (Colima: unix://$HOME/.colima/default/docker.sock).
- Sample app (optional): app.py with a small http.server that answers / and reads /app/templates/report.txt only on /report, plus a Dockerfile (FROM python:3.15.2-slim, WORKDIR /app, COPY app.py ., COPY templates/ templates/, EXPOSE 8000, CMD ["python", "app.py"]), built with: docker build -t example/app:fat .
- Look inside first (static, runs nothing): cd ~/docker_volumes/slim/reports and mint xray example/app:fat (use my image name).
- Slim it: mint slim --tag example/app:slim-try1 example/app:fat, then run it and call every route. A route that reads a file late (like /report) fails with FileNotFoundError.
- Fix what was missed: --include-path /app/templates (a path INSIDE the image, never a host path like ./templates), or --http-probe-cmd /report (asks for that page during the test), or --http-probe=false --continue-after=enter to click through the app by hand. For many paths use --include-path-file. Change one flag at a time and give every try its own tag (slim-try1, slim-try2).
- Shells, tools or certificates missing: --include-shell, --include-exe, --include-bin. Slow starting app: --http-probe-start-wait 20.

CHECK IT WORKED:
- mint --version prints a line containing 1.41.8.
- The slim image starts, stays up for a minute (docker ps), answers every route (curl each page and API call), and still works after docker restart <name>.
- One outbound HTTPS call from the slim image works (CA certificates are a common casualty).
- docker images example/app lists the fat and the slim image side by side; I compare the sizes myself. Keep the original image until all tests pass.

RULES FOR YOU:
- Use only Mint 1.41.8 and python:3.15.2-slim as written. The command is mint slim (the old slim build is only an alias); do not suggest brew install docker-slim or the old slimtoolkit/slim 1.40.11 (it fails on Docker 29 with "client version 1.33 is too old"). If a step fails, show me the exact error and read https://github.com/mintoolkit/mint before guessing.
- The temporary analysis container runs privileged and the Docker socket is root-equivalent: only slim images I trust, on a machine I can experiment on. Never put real keys into an image to help Slim; pass test values with --env.
- Do not use --obfuscate-metadata casually (it hides package names from vulnerability scanners). Mint is not a scanner: suggest Trivy or Grype for that.
- Values like example/app are dummies; ask me for my real image name.
- Never ask me to paste passwords, tokens or keys into this chat.

Step 1: Install Mint#

Work from one folder, ~/docker_volumes/slim. It holds the sample app, the Mint reports and the backups.

Linux#

This is the 64-bit x86 build, pinned to 1.41.8. For ARM64 use dist_linux_arm64.tar.gz and the folder dist_linux_arm64.

Run in terminalbash
mkdir -p ~/docker_volumes/slim/{app,reports,backups}
cd ~/docker_volumes/slim
MINT_VERSION=1.41.8
curl -fL -o mint.tar.gz "https://github.com/mintoolkit/mint/releases/download/${MINT_VERSION}/dist_linux.tar.gz"
echo "1b25208157657ea8a9ec94a9aa61f2dfc087710a6d938513bbeda43cce84142c  mint.tar.gz" | sha256sum -c -
tar -xzf mint.tar.gz
sudo install -m 0755 dist_linux/mint dist_linux/mint-sensor /usr/local/bin/
mint --version

The project publishes no checksum file. The hash is the SHA-256 of the file we downloaded on 5 December 2026, so it proves you got the file we inspected. Both programs must sit in one folder: Mint looks for mint-sensor next to itself.

Windows (PowerShell)#

There is no Windows build, so run Mint from its container. Docker Desktop shares the Docker socket with Linux containers. Create the folders, then define a mint function for this PowerShell window:

Codepowershell
$base = "$HOME\docker_volumes\slim"
foreach ($d in "app","reports","backups") {
  New-Item -ItemType Directory -Force "$base\$d" | Out-Null
}
Set-Location $base
docker pull mintoolkit/mint:1.41.8
function mint { docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock mintoolkit/mint:1.41.8 @args }
mint --version

The project says it never tested WSL 2 (maintainer comment, 7 January 2024), and we did not test Docker Desktop either. If this fails, run the Linux steps inside a Linux machine or VM instead. On Windows for ARM, use mintoolkit/mint-arm:1.41.8.

Mac (Terminal)#

Run in terminalbash
mkdir -p ~/docker_volumes/slim/{app,reports,backups}
cd ~/docker_volumes/slim
brew install mintoolkit
mint --version

The Homebrew formula is mintoolkit (stable 1.41.8 on 5 December 2026). Do not use brew install docker-slim from older guides: we found no formula with that name on formulae.brew.sh. Docker Desktop keeps its socket at ~/.docker/run/docker.sock. If ls /var/run/docker.sock fails, either tick Enable default Docker socket in Docker Desktop (Settings, Advanced) or run export DOCKER_HOST=unix://$HOME/.docker/run/docker.sock first. With Colima the socket is unix://$HOME/.colima/default/docker.sock (see our Colima guide).

Check it worked. mint --version prints a line that contains 1.41.8. For comparison, an issue report shows the format of the earlier release: mint version linux/amd64|Aurora|1.41.7|<commit>|<date>.

Tip: Keep mint and mint-sensor together. If you move only mint, it stops with message='sensor binary not found' (from the source) and exit code -999.

Step 2: Create a small sample app#

The app has two pages. / is simple. /report reads a file only when someone asks for that page, which is exactly the kind of file Slim can miss. example/app is a dummy image name.

Linux#

Run in terminalbash
mkdir -p ~/docker_volumes/slim/app/templates
cd ~/docker_volumes/slim/app
cat > app.py << 'EOF'
from http.server import BaseHTTPRequestHandler, HTTPServer
from pathlib import Path

class Handler(BaseHTTPRequestHandler):
    def do_GET(self):
        if self.path == "/report":
            body = Path("/app/templates/report.txt").read_text()  # opened only on this page
        else:
            body = "hello from the example app\n"
        data = body.encode()
        self.send_response(200)
        self.send_header("Content-Length", str(len(data)))
        self.end_headers()
        self.wfile.write(data)

HTTPServer(("0.0.0.0", 8000), Handler).serve_forever()
EOF
echo "report page (dummy content)" > templates/report.txt
cat > Dockerfile << 'EOF'
FROM python:3.15.2-slim
WORKDIR /app
COPY app.py .
COPY templates/ templates/
EXPOSE 8000
CMD ["python", "app.py"]
EOF
docker build -t example/app:fat .

Windows (PowerShell)#

Codepowershell
$app = "$HOME\docker_volumes\slim\app"
New-Item -ItemType Directory -Force "$app\templates" | Out-Null
Set-Location $app
@'
from http.server import BaseHTTPRequestHandler, HTTPServer
from pathlib import Path

class Handler(BaseHTTPRequestHandler):
    def do_GET(self):
        if self.path == "/report":
            body = Path("/app/templates/report.txt").read_text()  # opened only on this page
        else:
            body = "hello from the example app\n"
        data = body.encode()
        self.send_response(200)
        self.send_header("Content-Length", str(len(data)))
        self.end_headers()
        self.wfile.write(data)

HTTPServer(("0.0.0.0", 8000), Handler).serve_forever()
'@ | Set-Content -Encoding ascii app.py
"report page (dummy content)" | Set-Content -Encoding ascii templates\report.txt
@'
FROM python:3.15.2-slim
WORKDIR /app
COPY app.py .
COPY templates/ templates/
EXPOSE 8000
CMD ["python", "app.py"]
'@ | Set-Content -Encoding ascii Dockerfile
docker build -t example/app:fat .

Mac (Terminal)#

Same commands as Linux.

Check it worked. Start the original, ask for both pages, then stop it.

Run in terminalbash
docker run --rm -d --name app-fat -p 8000:8000 example/app:fat
curl -s http://localhost:8000/
curl -s http://localhost:8000/report
docker stop app-fat

On Windows PowerShell, use curl.exe instead of curl. You should see hello from the example app and report page (dummy content).

Step 3: Look inside the image with xray#

xray is a static look: it does not run your app. It lists layers, big files and a reconstructed Dockerfile, and writes slim.report.json into the current folder.

Linux#

Run in terminalbash
cd ~/docker_volumes/slim/reports
mint xray example/app:fat

Windows (PowerShell)#

Codepowershell
Set-Location "$HOME\docker_volumes\slim\reports"
mint xray example/app:fat

Mac (Terminal)#

Same commands as Linux.

Check it worked. The output lists the image layers and its largest files. For a layer-by-layer view, see our dive guide. On Windows the report file stays inside the container, so read the console output.

Step 4: Slim it, and see what goes missing#

Build the first slim image without any extra hints. The tag is our choice; without --tag Mint names it <image>.slim. Mint starts a temporary container, requests GET / on the exposed port (HTTP, then HTTPS) and builds the image from what the app used.

Linux#

Run in terminalbash
cd ~/docker_volumes/slim/reports
mint slim --tag example/app:slim-try1 example/app:fat
docker run --rm -d --name app-try1 -p 8000:8000 example/app:slim-try1
curl -s http://localhost:8000/
curl -s http://localhost:8000/report
docker logs app-try1 --tail 20
docker stop app-try1

Windows (PowerShell)#

The mint function from Step 1 runs the container; use curl.exe.

Codepowershell
Set-Location "$HOME\docker_volumes\slim\reports"
mint slim --tag example/app:slim-try1 example/app:fat
docker run --rm -d --name app-try1 -p 8000:8000 example/app:slim-try1
curl.exe -s http://localhost:8000/
curl.exe -s http://localhost:8000/report
docker logs app-try1 --tail 20
docker stop app-try1

Mac (Terminal)#

Same commands as Linux.

What we expect, from how Slim works: / still answers, while /report fails because templates/report.txt was never opened during the test (the log should show a FileNotFoundError). We did not run this, so it is the documented behaviour, not output. The Mint log should show lines such as cmd=slim state=started.

Tip: --include-path takes a path inside the image (/app/templates), not a folder on your computer. A path like ./templates is a very common mistake.

Step 5: Tell Slim what it missed#

There are two fixes. Use the first for files and folders you know about. Use the second when the app must run a code path so Slim sees it.

Fix A: keep the path. --include-path keeps a directory and everything in it. You can repeat it.

Fix B: ask for the page during the test. --http-probe-cmd adds a request to the probe. The format is [[[[crawl:]PROTO:]METHOD:]PATH], so --http-probe-cmd /report runs GET /report.

Linux#

Run in terminalbash
cd ~/docker_volumes/slim/reports
mint slim --tag example/app:slim --include-path /app/templates example/app:fat
docker run --rm -d --name app-slim -p 8000:8000 example/app:slim
curl -s http://localhost:8000/
curl -s http://localhost:8000/report
docker restart app-slim
curl -s http://localhost:8000/report
docker images example/app
docker stop app-slim

To use Fix B instead, replace the Mint line with mint slim --tag example/app:slim --http-probe-cmd /report example/app:fat.

Windows (PowerShell)#

Codepowershell
Set-Location "$HOME\docker_volumes\slim\reports"
mint slim --tag example/app:slim --include-path /app/templates example/app:fat
docker run --rm -d --name app-slim -p 8000:8000 example/app:slim
curl.exe -s http://localhost:8000/
curl.exe -s http://localhost:8000/report
docker restart app-slim
curl.exe -s http://localhost:8000/report
docker images example/app
docker stop app-slim

Mac (Terminal)#

Same commands as Linux.

For many paths, put one per line in a file and use --include-path-file. The containerised Mint (Windows) cannot see your files unless you mount them (issue 439 below).

For your own tests use --continue-after. With --http-probe=false --continue-after=enter, Mint starts the temporary container, prints the host port (look for port.list and target.port.info) and waits. Click through the app or run your test suite against that port, then press Enter. Other values: probe, exec, signal, a number of seconds, or 'probe&exec' (quoted, so the shell does not read the &).

Check it worked. Both pages answer, before and after the restart. docker images example/app shows fat and slim side by side. We have not measured this app, so we give no number.

Test the slim image properly#

A size drop proves nothing. Test the things your users do.

TestHow
Starts and stays updocker run -d, wait a minute, docker ps still lists it
Every routecurl each page and API call, including the rare ones
Restartdocker restart <name>; files created during Slim's test are kept and can break a second start (issue 475 below)
Outbound HTTPSOne call to an external site; CA certificates are a common casualty
A repeatable checkDescribe the expected ports, files and answers in a Goss file and run it against the fat and the slim image

Compare the two images with dive and scan both with Trivy. A smaller image usually has fewer findings, but --obfuscate-metadata hides package names, and with them some vulnerabilities, from scanners, so do not use it casually. For small images by design, see distroless and Wolfi images.

Before and after: what the project reports#

We did not measure real images for this page. These are the examples from the project's own README (undated, old base images):

Base imageBeforeAfterFactor
Node app on ubuntu:14.04432 MB14 MB30.85x
Python app on python:2.7.15916 MB27.5 MB33.29x
Go app on golang:latest700 MB1.56 MB448.76x
Node app on node:alpine66.7 MB34.7 MB1.92x
Python app on python2.7:distroless60.7 MB18.3 MB3.32x
archlinux:latest, running only curl467 MB17.4 MBabout 27x

The lesson is in the shape: a fat base image shrinks enormously, an already small one only a little. Our sample starts from python:3.15.2-slim (about 44 MB compressed on Docker Hub, amd64), so expect a modest gain, not a miracle.

Why a slimmed image can miss files#

A file is kept when the sensor sees the app open it, or when a rule says to keep it (runtime libraries, certificates, a shell if you ask). A file the app would only open later is never seen, so it is dropped. The usual victims:

  • templates, static files and plugins loaded for one route or job;
  • CA certificate bundles used by a later outbound HTTPS call;
  • shells and tools started by scripts (--include-shell, --include-exe, --include-bin);
  • directories a program expects to exist, such as nginx's temporary folder.

Three tools fix this: --include-path (keep it), --http-probe-cmd (make the app use it during the test) and --continue-after (run your own tests during the test).

Put it behind HTTPS with Traefik? You do not need to#

Mint is a command-line tool. It opens no port and serves no web page, so there is nothing to route.

With Traefik#

No labels are needed. If your slimmed app is a web app that you later publish, put the slimmed image in your Compose file and follow our Traefik guide for that app.

Without Traefik: Caddy#

No reverse_proxy line is needed for Mint itself. For the app you slimmed, our Caddy guide shows the Caddyfile.

Security and testing#

ControlHow
Docker socketMint needs the socket, and access to it is root-equivalent. Do not mount it into an image you do not trust
Privileged helperThe temporary analysis container runs privileged with SYS_ADMIN (source at 1.41.8, and the README). Only slim images from sources you trust, on a machine you can afford to experiment on
Reportsslim.report.json holds details of your image, such as file names and settings. Keep it out of public issues and Git
SecretsNever bake keys into an image to help Slim. Pass test values with --env; keep real ones in .env (mode 600)
ScanningScan both images with Trivy or Grype and Syft

Quick tests:

Run in terminalbash
docker ps
mint --version
mint slim --tag example/app:slim example/app:fat
docker images example/app

We did not run these. Expected: a version line with 1.41.8, a Mint log that ends with the new image, and two images in the list.

Common mistakes#

MistakeWhy it happensDo this instead
AI assistants: telling you to brew install docker-slim and run slim buildOlder guides and the 1.40.11 README use the old namesUse brew install mintoolkit and mint slim. We found no docker-slim formula on formulae.brew.sh. build still works as an alias
AI assistants: saying the Linux mint-sensor in the Mac download is the wrong fileIt is an ELF file, and a Mac cannot run it, so it looks wrongIt is meant for the Linux temporary container. We checked both Mac zips: mint is a Mac program, mint-sensor is Linux. The real fault in issue 459 was the sensor not being copied
AI assistants: --include-path ./templates or a host pathThey treat it like a Docker bind mountIt is a path inside the image: --include-path /app/templates
AI assistants: copying the probe-file JSON from the old READMEThe 1.40.11 README spells a field "procotol". PR 860 fixed the typo in September 2026Write "protocol". The Mint 1.41.8 README has it right
Slimming a reusable base imageThere is no app to watch, so even /bin/sh is dropped. A child image then fails with exec: "/bin/sh": stat /bin/sh: no such file or directory (issue 14)Slim the final app image. For a base, add --include-shell, --include-exe, --include-bin
Slim 1.40.11 on Docker 29It sends an old API version: client version 1.33 is too old. Minimum supported API version is 1.40 (issue 845)Use Mint 1.41.8. On old Slim, add --crt-api-version=<a version your Docker accepts>
Running the Mint container without mounting your filesOnly the socket is shared, so --compose-file or --include-path-file cannot be read: open /docker-compose.yml: no such file or directory (issue 439)Add -v <your-folder>:/work and pass /work/<file>
Trusting a successful buildA Python app lost certifi/cacert.pem: FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.7/dist-packages/certifi/cacert.pem' (issue 165)Test outbound HTTPS, then --include-path the real path from your image. One later commenter said it did not help them, so test again
A custom nginx temp foldernginx does not create missing parent folders: nginx: [emerg] mkdir() "/var/lib/nginx/body" failed (README FAQ)Add --include-path for the folder your nginx config uses
Starting an image that ran fine onceFiles created during Slim's test were kept. A php-apache image failed with mkdir: cannot create directory '/var/lock': File exists (issue 475)Test a restart. --exclude-varlock-files is on by default since 1.40.11 but did not help one 2025 reporter

Tip: After a failed run, read the container log first: docker logs <name> --tail 50. The missing path is usually named in the first error line.

Tip: Change one flag at a time and give every slim image its own tag (slim-try1, slim-try2). Then you can tell which flag helped, and you never overwrite a working image.

Troubleshooting#

ProblemSolution
mint: command not foundCheck ls /usr/local/bin/mint; on Windows, define the mint function again in each new PowerShell window
Mint cannot reach DockerRun docker ps first. On Mac set DOCKER_HOST or enable the default socket (Step 1). In CI, see --sensor-ipc-mode in the README
Slim "succeeded" but the app will not startdocker logs <name>; compare with mint xray of the original; add --include-path
The probe fails or the app is slow to startAdd --http-probe-start-wait 20 (seconds), or use --continue-after enter and test by hand
You need a shell in the slim imageUse --include-shell, or debug with a side-car: mint debug. Our netshoot guide covers a ready debug image

client version 1.33 is too old. Minimum supported API version is 1.40#

Full text from issue 845 (Docker 29.3.0, the Slim release of March 2026, which is 1.40.11):

Run in terminaltext
level=error msg="image.inspector.NoImage: err=API error (400): client version 1.33 is too old. Minimum supported API version is 1.40, please upgrade your client to a newer version"

This is the old Slim, not your Docker. Move to Mint 1.41.8, whose default API version is 1.44. Per the Docker API table, Docker 29.0 to 29.2 accept 1.44 as their minimum, and 29.3 and later accept 1.40 and up. The reporter's workaround on Slim was --crt-api-version=1.54, his server's version.

exec /opt/_slim/bin/slim-sensor: no such file or directory#

Full text from issue 459 (Slim 1.40.11):

Run in terminaltext
exec /opt/_slim/bin/slim-sensor: no such file or directory

The maintainer called this error misleading: the real problem is that the sensor is not where Mint expects it, locally or in the sensor volume. Check that mint-sensor sits next to mint, and that you installed a matching pair. In Mint the path reads /opt/_mint/bin/mint-sensor.

Known bugs (December 2026)#

  • WSL 2 is untested. The maintainer said so on 7 January 2024. Docker Desktop on Windows is untested by us.
  • Docker 29 and the containerd image store. Mint issue 174 (open) reports that an arm64 run can pick the amd64 variant of a multi-architecture image. Its workaround is the overlay2 storage driver.
  • README lags the code. The Mint 1.41.8 README still lists API default 1.32 and "latest version 1.41.7"; the source at the tag sets 1.44.
  • /var/lock failures (issue 475) and multi-service images with s6 (issue 161) have no fix.

Updates and backups#

Update Mint. 1.41.8 (12 December 2025) is the latest release on 5 December 2026. When a new one appears, read its notes, then reinstall (Mac: brew upgrade mintoolkit; Windows: change the tag in the mint function and docker pull it):

Run in terminalbash
MINT_VERSION=<new-version>
curl -fL -o mint.tar.gz "https://github.com/mintoolkit/mint/releases/download/${MINT_VERSION}/dist_linux.tar.gz"
tar -xzf mint.tar.gz
sudo install -m 0755 dist_linux/mint dist_linux/mint-sensor /usr/local/bin/
mint --version

The README also documents mint update; we prefer the explicit install because you choose the version. Slimmed images do not update themselves: when your base image gets a fix, rebuild the original and slim it again. Our Diun guide can tell you when a base image changes.

What to back up. Your Dockerfile and app (Git is best), the flags you used (a slim-build.sh file in the app folder), any --include-path-file or probe files, and the reports. Slim images can be rebuilt, so skip them.

Linux and Mac#

Save as ~/slim-backup.sh:

File contentbash
#!/usr/bin/env bash
set -euo pipefail
out="$HOME/docker_volumes/slim/backups/slim-$(date +%F).tar.gz"
tar -czf "$out" -C "$HOME/docker_volumes/slim" app reports
chmod 600 "$out"

Run chmod 700 ~/slim-backup.sh, then add this line with crontab -e to run it every Sunday at 03:00:

File contenttext
0 3 * * 0 /home/<your-user>/slim-backup.sh

On a Mac, write /Users/<your-user>/slim-backup.sh.

Windows (PowerShell)#

Save as $HOME\slim-backup.ps1:

Codepowershell
$ErrorActionPreference = "Stop"
$root = "$HOME\docker_volumes\slim"
$out = "$root\backups\slim-$(Get-Date -Format yyyy-MM-dd).tar.gz"
tar -czf $out -C $root app reports
if ($LASTEXITCODE -ne 0) { throw "tar failed" }

In Task Scheduler, run powershell.exe -NoProfile -File <full-path-to-the-script> weekly on Sunday at 03:00.

Restore test#

Unpack into a spare folder, rebuild and slim again, then run the tests from Step 6:

Run in terminalbash
mkdir -p /tmp/slim-restore && tar -xzf ~/docker_volumes/slim/backups/slim-<date>.tar.gz -C /tmp/slim-restore
cd /tmp/slim-restore/app && docker build -t example/app:fat .
mint slim --tag example/app:slim --include-path /app/templates example/app:fat

On Windows PowerShell, extract with tar -xzf into a spare folder the same way. The restore is proven only when the rebuilt slim image answers on both pages. We did not run this test.

Performance and resources#

  • Disk: the Mint image is about 26 MB compressed; the Linux program and sensor are about 76 MB unpacked (file sizes in the 1.41.8 archive).
  • Time and memory: we did not measure them. Mint reads your image, starts it, probes it and builds a new one; a slow-starting app needs --http-probe-start-wait. Watch a run with docker stats; the temporary container is removed at the end.
  • Cleanup: remove failed experiments with docker image rm example/app:slim-try1. Our Docuum guide can clean unused images automatically.

FAQ#

Is Slim the same as Mint? Yes. DockerSlim became SlimToolkit and then Mint. The maintainer says new work goes to Mint, and mint slim is the old slim build.

Can I still use slim 1.40.11? It works on older Docker, but it is from February 2024 and fails on Docker 29 unless you set --crt-api-version. Use Mint 1.41.8 for new work.

Is it safe for production? The README says yes, and adds: "you should test your Docker images". Test every route and a restart, and keep the original image.

Will it work with my language? The README lists Node.js, Python, Ruby, Java, Go, Rust, Elixir and PHP (some app types). Web apps are easiest because Mint can send requests for you.

Does it shrink distroless or Alpine images? Less. The README's own Node Alpine example went from 66.7 MB to 34.7 MB. Check distroless and Wolfi images if you are choosing a base.

Do I need Kubernetes? No. This guide is Docker only. For Kubernetes see our introduction.

Sources#

Checked against the official docs on 2026-12-05. Nothing was run on a real machine by DIY Lab Hub; the commands come from the docs, the release files, the source and the issues above.

Try one of these