Code tool

Docker Run to Compose Converter

Paste a docker run command to generate a copy-ready compose.yaml service without sending your command anywhere.

In-browser processingNo account requiredPrivacy details ↗

Paste one docker run command. Common ports, environment variables, volumes, restart, network, hostname, workdir, entrypoint, and command options are supported.

A QUICK WALKTHROUGH

How to use this tool

  1. Paste one docker run command, including options such as ports, environment variables, volumes, and a name.
  2. Convert it and review the generated Compose YAML plus any unsupported flags.
  3. Copy the YAML or download it as compose.yaml.

Common Docker options

The converter understands detached mode, container names, port mappings, environment variables, volumes, restart policies, networks, hostnames, work directories, and the remove flag. The image is required.

Review before running

Docker has many flags and shell grammars. Unsupported options are listed after conversion so you can confirm the YAML before using it. Conversion happens entirely in your browser.

GOOD TO KNOW

Common questions

Does this run Docker?

No. It only translates text into Compose YAML; review and run the result yourself.

Which flags are supported?

Common flags include --name, -p/--publish, -e/--env, -v/--volume, --restart, --network, --hostname, --workdir, --rm, and --entrypoint.

Can I paste a shell script?

Paste one docker run command. Shell quoting is handled for common quoted values, but complex shell expansion should be reviewed manually.