Skip to main content
Back to Tools
Web Tools

Docker Run to Compose Converter

Convert docker run commands to docker-compose.yml format. Parses ports, volumes, environment variables, networks, capabilities, resource limits, and 20+ other flags. Handles multiline commands, quoted values, and combined short flags. Warns about unsupported options. Runs entirely in your browser — your data never leaves your machine.

docker compose converter yaml devops container

Published May 31, 2026

All interactive tools run entirely in your browser. Your data never leaves your device.

How It Works

Paste any docker run command and get an equivalent docker-compose.yml service definition instantly. The parser handles ports, volumes, environment variables, restart policies, networks, capabilities, resource limits, logging, and many more flags.

Features

  • 20+ flags supported: -p, -v, -e, —name, —restart, —network, —entrypoint, —workdir, —user, —hostname, —privileged, —tty, —read-only, —cap-add/drop, —add-host, —dns, —tmpfs, —device, —memory, —cpus, —log-driver, —label
  • Smart parsing: handles combined flags (-dit), short flags without space (-p8080:80), quoted values, and backslash line continuations
  • Service name inference: derives service name from container name or image path
  • Warning system: alerts about unsupported flags and options without direct compose equivalents
  • One-click copy: copy generated YAML to clipboard
  • 5 examples: Nginx, PostgreSQL, Redis, Node.js app, interactive Ubuntu
  • Private: all computation runs in your browser — no data transmitted

Use Cases

  • Migrating standalone docker run commands from scripts to docker-compose
  • Converting container startup commands from documentation to compose format
  • Building docker-compose.yml files from existing running containers
  • Learning the mapping between docker run flags and compose keys