Docker Run ↔ Compose Converter

Convert docker run commands to Compose YAML and back, with a report of what converted

docker run Input

Up to 256 KB. Commands are parsed, never executed.

Options

Indentation

Compose Output

Paste one or more docker run commands, or load an example.
Paste one or more docker run commands, or load an example.
What does the converter do?

It turns docker run commands into a Compose file and turns a Compose file back into docker run commands. Both directions go through one normalized container model instead of text rewriting, so ports, volumes, environment variables, networks, health checks, resource limits and quoting are understood rather than copied. Every flag or key lands in a report as Exact, Approximate or Unsupported, so nothing is dropped silently.

How to use it
  1. 1.Choose Docker Run → Compose or Compose → Docker Run.
  2. 2.Paste commands or a Compose file, open a file, or load an example.
  3. 3.Pick the Compose target, indentation or command layout.
  4. 4.Read the conversion report under the output, then copy or download the result.
What converts exactly

Ports with host IPs, ranges and protocols; -v and --mount volumes; environment variables with quotes, spaces and dollar signs; restart policies; user-defined networks with aliases and static IPs; health checks, logging, ulimits, capabilities, devices and most resource flags. Literal dollar signs become $$ so Compose does not treat them as variables, while $VAR references stay variables. Several commands, separated by blank lines, semicolons or &&, become several services, named after --name, then the image name.

Limits and privacy

depends_on, profiles, build, secrets, configs and most deploy settings have no docker run equivalent and are reported instead of converted. Compose prefixes networks and volumes with the project name, while docker run does not; the report says when that matters. Commands are parsed, never executed, and input is limited to 256 KB. Pasted commands and files are not saved; only your display preferences are remembered.

CodingTool is officially live on

Launched on StartupBaseCodingTool.dev - Free, Fast & Easy Developer Tools in One Place | Product HuntCodingTool - Featured on Startup FameFazier badgeListed on Turbo0Featured on Twelve ToolsFeatured on Findly.toolsLaunchpadly Startup DirectoryCodingTool.dev — Featured on Smol Launch