Skip to content
LovTools
EN

Docker Run to Compose Converter

Convert a docker run command into a docker-compose.yml service.

Processed locally on your device — nothing is uploaded.

About the Docker Run to Compose Converter

Found a docker run command in a README and want it in your compose file? Paste the command — line continuations, quotes and sudo are fine — and get a ready-to-use compose service with image, container name, ports, volumes and mounts, environment variables, env files, restart policy, networks, working directory, user, capabilities, memory and CPU limits, logging, health check and more.

Named volumes are declared at the bottom, custom networks are marked as external, --network host becomes network_mode: host, and port mappings are quoted as Docker recommends. Flags that have no direct Compose equivalent are listed so you can add them by hand.

How to use the Docker Run to Compose Converter

  1. Paste a docker run command.
  2. Review the generated YAML and any unconverted flags.
  3. Save it as compose.yaml and run docker compose up -d.

Features

  • 35+ options converted
  • Named volumes and networks declared
  • Quoted port mappings
  • Lists unconverted flags

Supported formats

  • Plain text

Frequently asked questions

What happens to --rm and -d?

Compose runs services detached with up -d and keeps containers, so these flags are not needed.

Is my text sent anywhere?

No. Everything runs in your browser, so nothing you paste is uploaded or stored.

Added · Last reviewed · Maintained by Sohail Khax · How we test tools