Docker Run to Compose
Convert docker run commands to docker-compose.yml.
Runs on your machine. Nothing you paste is uploaded.
Get Docker Run to Compose and 121 other tools. Free for 7 days, no account needed.

What it does
Paste a docker run command and get an equivalent docker-compose.yml service. Ports, volumes, environment variables, env files, labels, container name, restart policy, network, working directory, user, hostname, entrypoint and the trailing command all map to their Compose keys.
Quoted values, line continuations and combined short flags like -dit are parsed the way a shell would. Flags that have no mapping are not dropped silently: they are listed in a comment at the top of the file so you can add them by hand. A named network is declared as external.
When you would reach for it
- Move a database container you started from a README command into a Compose file.
- Turn a long docker run line from a deployment script into readable YAML for review.
- Combine several single-container commands into one Compose stack for local development.
- Check which flags of an existing command Compose won't pick up automatically.
Also found by searching
- docker
- compose
- convert
- container
- yml