Docker run → Compose converter

← All tools

Paste a docker run command and get a matchingcompose.yaml service — ports, environment, volumes, restart policy, network, working directory, user, entrypoint, and command.

Your command never leaves the browser — no upload, no server.

~~~

Input

Could not parse command

~~~

Warnings

Unsupported flags

Compose output

~~~

About this tool

docker run is great for one-off containers. When you need the same setup again — same ports, env vars, volumes — a Compose file is easier to version and share. This converter tokenizes your shell command (quotes and escapes included) and maps common flags to Compose fields.

Some runtime-only flags (--rm, -P,--env-file, GPU/device mounts) have no direct Compose equivalent and are listed as warnings or unsupported. Always review the generated YAML before deploying.

~~~

Read more