Docker Run to Compose Converter - MacigHub

Paste any docker run command and get an equivalent docker-compose.yml service definition automatically.

Popular tools: Base64 · JSON Diff · UUID · QR Code · Regex · Password

About this tool

What does it convert?

Long docker run command lines into clean docker-compose.yml services — ports, volumes, environment, networks and restart policies mapped to their Compose equivalents.

How to use it

  • Paste the docker run command.
  • Review the generated service: names, mounts, env.
  • Save as compose file and bring the stack up.

Examples

  • Turning a wiki-page run command into versioned compose.
  • Migrating five containers into one compose stack.
  • Documenting tribal-knowledge flags as code.

Important limitations

  • Exotic flags (devices, sysctls, configs) need manual review after conversion.
  • Secrets in -e flags must move to env files, not into git.
  • Compose version semantics differ — target your installed version.

Privacy

Local text transform. Run commands often embed secrets — they stay in your browser.

Frequently asked questions

Volumes syntax?

Short host:container converts directly; named volumes get a top-level block.

--network=host?

Becomes network_mode: host — with its well-known trade-offs.

Env files?

Prefer env_file over inline environment for anything secret.

Related tools

YAML prettify · List converter · Text diff