CodeConverter

About the Docker Run to Compose Converter

The Docker Run to Compose Converter turns one or more docker run commands into a docker-compose.yml. It maps ports, volumes, environment variables, networks, restart policy, healthchecks, resource limits and more, declares named volumes and networks at the top level, and lists any flag with no Compose equivalent (such as --rm) as a warning instead of dropping it silently.

How to use the Docker Run to Compose Converter

  1. Paste one or more docker run commands (backslash line continuations are fine).
  2. Click Convert to Compose.
  3. Review the warnings, then copy or download docker-compose.yml.

Frequently asked questions

Can I convert several docker run commands at once?

Yes. Each docker run command becomes one service in the same file, named after --name or the image.

What happens to flags that Compose does not support?

They are reported as warnings. For example --rm has no Compose equivalent, and unknown flags are ignored with a note so nothing disappears silently.

Are my data stored when I use the Docker Run to Compose Converter?

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.

Is the Docker Run to Compose Converter 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/docker-run-to-compose; see the API documentation for the fields and examples.