WHAT IT DOES
The command you ran once, as the file you keep.
Paste a docker run command and get the Compose service it describes. Ports, environment variables, volumes, labels, healthchecks, logging, resource limits, and around sixty other flags are translated to their Compose keys. The command is split the way a shell splits it, so a quoted healthcheck stays one argument, and a command pasted across several lines with backslashes converts as written.
Why use it?
Use it to turn a one-off container command into a reviewable service definition while seeing which run-time flags do not translate.
How to use this tool
- Paste the complete docker run command, retaining quotes and arguments after the image, then convert.
- Review the generated service and comments for unsupported or invocation-only flags. For example, -p 8080:80 must retain host port 8080 and container port 80 in that order.
- Replace any real credentials before committing the file, check referenced files and external networks, and validate the result with your installed Docker Compose before starting it. Conversion itself starts no container.
Details and limitations
- Every flag is either translated or reported. A flag with no Compose equivalent is listed as a comment at the top of the file rather than dropped, because a service quietly missing a capability fails later and in production.
- The service is named after --name, or after the image when there is no container name, so ghcr.io/acme/api:v2 becomes a service called api.
- Repeated flags collect into one list, --flag=value and --flag value are read identically, and bundled short flags such as -it are expanded.
- Flags Compose groups under one key are nested for you: the health and log options become healthcheck and logging blocks.
- A named network is declared as external at the top level as well as referenced by the service, because Compose refuses a file that references a network it has never heard of.
- Everything after the image is kept as the container's command, and -d, --rm, and their relatives are explained rather than translated: they describe one run, not the service.