Dockerfile Optimizer

Find Dockerfile waste and get concrete fixes.

Runs in your browser. Nothing is uploaded — your input is processed on this device and discarded when you close the tab.

Dockerfile Optimizer

How to use this tool

  1. Paste a Dockerfile in the box.
  2. Press Analyse to see findings ordered by the line they concern, each with a fix.
  3. Use Load sample for a file with a latest tag and a split apt-get update.

Worked example

The sample FROM node:latest with a separate RUN apt-get update and a later RUN apt-get install -y curl produces at least two findings: the latest tag is pinned to nothing, so builds are not repeatable; and apt-get update runs in its own layer, so the package list can go stale while the install layer is cached. The suggested fix merges update, install and cache cleanup into one RUN.

What this tool does not do / Limits

This is a text review, not a build: it cannot measure image size, cannot see your .dockerignore, and cannot know which base image versions exist. Treat its findings as a checklist, then test the changed Dockerfile with a real build before shipping it.

Frequently asked questions

Does it rebuild my image?

No. It only reads the text you paste. No container is built and no registry is contacted.

Why is ADD flagged?

ADD can fetch remote URLs and unpack archives, which surprises readers. COPY does the plain copy most Dockerfiles mean.

Related tools