docker run ↔ Compose
Convert docker run commands to docker-compose and back
Turn docker run commands into a docker-compose.yml service (ports, volumes, env, health checks, resources), or a Compose service back into docker run commands, with warnings for anything that does not map.
- Docker
- Compose
- YAML
- docker run
How to use docker run ↔ Compose
- Paste one or more
docker runcommands, or a Compose file, into the input, drop a file on it, or use Open file. docker run example and Compose example load samples. - Leave the direction on Auto-detect (a command that starts with
docker,podmanorsudo dockeris converted to Compose, anything else is read as Compose YAML), or choose docker run → Compose or Compose → docker run. - For Compose → docker run, tick Add -d (detached) and One option per line as you like.
- Read the warnings and notes under the output, then copy the result, download it as
docker-compose.ymlordocker-run.sh, or send it to another tool.
How it works
The command is split into words with a POSIX shell tokenizer (quotes, backslash line continuations,