HomeDocker Run to Docker Compose Converter

Docker Run to Docker Compose Converter

Online Docker Run to Docker Compose converter that parses docker run commands and generates compose YAML with unmappable option and error hints

Docker Run Command

Actions


Docker Compose Output

Waiting for command input...

Conversion Hints

No additional hints right now.



Documentation

About Docker Run to Docker Compose Converter

This tool converts a docker run command into a docker-compose.yml snippet, making one-off container commands easier to migrate into maintainable Compose workflows.

Key Features

  • Parses common docker run options and outputs Compose YAML.
  • Separates options that cannot be mapped directly for manual review.
  • Lists options that are not implemented for auto conversion yet.
  • Reports command format issues with clear error items.
  • Supports one-click copy and docker-compose.yml download.

Supported Options

Current support includes: --name, -p/--publish, -v/--volume, -e/--env, --env-file, --restart, --network, --entrypoint, --cpus, --memory/-m, --memory-reservation, --memory-swap, -w/--workdir, -u/--user, -h/--hostname, --add-host, --dns, --dns-search, --dns-option, --label, --log-driver, --log-opt, --device, --cap-add, --cap-drop, --security-opt, --tmpfs, --health-cmd, --health-interval, --health-timeout, --health-start-period, --health-retries, --platform, and boolean flags --privileged, --read-only, -i/--interactive, -t/--tty, --init.

Conversion Rules

  • Output defaults to Compose version: "3.9".
  • Service name prefers --name; otherwise it is inferred from image name.
  • Trailing command arguments are mapped to the command array.
  • -d/--detach and --rm are reported as non-direct mappings.
  • --mount, --pull, and --gpus are currently marked as not implemented.

Steps

  1. Paste a one-line or multiline docker run command.
  2. Click Convert Now or edit input for live conversion.
  3. Review YAML output and hint blocks for manual completion.
  4. Copy result or download docker-compose.yml.

Use Cases

  • Migrate local container startup commands into Compose projects.
  • Normalize legacy docker run scripts before delivery.
  • Review container configs before deployment handoff.

Privacy

All parsing and YAML generation run locally in your browser without uploading command content.