Docker run to Compose
Convert a docker run command into a docker-compose service definition.
Loading tool…
About the docker run to compose
Parses a docker run command — including quoted arguments and backslash line continuations — and produces the equivalent docker-compose service definition. Ports, volumes, environment variables, restart policy, resource limits and capabilities all map across, and anything without an equivalent is listed rather than silently dropped.
Frequently asked questions
Why move from docker run to Compose?
A Compose file is version-controllable, reviewable and reproducible. A long run command in someone's shell history is none of those, and it is where undocumented production config tends to hide.
Do I still need the version key?
No. Compose V2 ignores it and warns about it. The toggle exists only for older tooling that still expects to find one.