CodeConverter

About the Dockerfile Optimizer

The Dockerfile Optimizer reads your Dockerfile and reports unpinned or oversized base images, cache-busting COPY order, apt, pip and apk habits that bloat layers, secrets baked into ENV or ARG, root users, shell-form CMD and more. Fixes that cannot change what the image does are applied to an optimized copy; everything else is explained and left for you to decide.

How to use the Dockerfile Optimizer

  1. Paste your Dockerfile.
  2. Click Optimize.
  3. Review the findings and copy or download the optimized Dockerfile.

Frequently asked questions

What does it change automatically?

Only safe edits: --no-install-recommends and cache cleanup for apt, --no-cache-dir for pip, --no-cache for apk, MAINTAINER to LABEL, ADD to COPY for plain local files, and merging adjacent simple RUN lines.

What does it only report?

Anything that could change behaviour: unpinned base images, secrets in ENV, COPY order, running as root, curl piped to a shell and multi-stage suggestions. RUN lines that change shell state, such as cd or export, are never merged.

Are my data stored when I use the Dockerfile Optimizer?

The text you submit is processed in memory to produce the result and is not saved. Like any web server, Code Converter logs basic visit data (page, IP address and browser) but never the content you paste. Even so, use placeholder values instead of real production credentials.

Is the Dockerfile Optimizer free, and can I call it from a script?

It is free and needs no account or signup. The same tool is available as a REST endpoint at POST /api/dockerfile-optimizer; see the API documentation for the fields and examples.