docker run command including all flagsReady to convert
Paste adocker run command and click Convert
// paste docker run → get compose yaml in one click
Paste a docker run command and instantly get the equivalent docker-compose.yml service block. Free, browser-based, no sign-up required.
docker run command including all flagsReady to convert
Paste adocker run command and click Convert
Copy your docker run command from the terminal, docs, or a README.
Click Convert — all flags are parsed and mapped to their Compose equivalents.
Copy the YAML block or download a docker-compose.yml file ready to deploy.
This tool parses docker run commands and converts them into valid docker-compose.yml service blocks. All common flags are supported — ports, volumes, environment variables, networks, resource limits, health checks, and more.
Yes. Line continuations using backslash (\) are automatically normalized so the full command is parsed correctly regardless of formatting.
No. All parsing is performed server-side only during the request — nothing is logged, stored, or sent to third parties. Your commands stay private.
The output uses the modern top-level services: format compatible with Docker Compose v2 and later. The deprecated version: key is intentionally omitted.
Flags that have no direct Compose equivalent (like --link) are noted with a warning comment in the YAML output so you know to review them manually.
Currently the tool converts one docker run command at a time. You can convert each service separately and combine the resulting YAML blocks into one docker-compose.yml file.
Named networks (not host, bridge, or none) are added to both the service's networks: block and a top-level networks: section marked external: true.
Running containers with docker run is great for quick experiments, but as your stack grows you need something more maintainable. Docker Compose lets you define all your services, networks, and volumes in a single YAML file that you can version-control, share with teammates, and deploy consistently across environments.
💡 Looking for professional web development assets? MonsterONE offers unlimited downloads of templates, UI kits, and Docker-ready app starters — worth checking out.
Long docker run commands are error-prone. A single missed flag can break your application, and there's no built-in way to share or reproduce the exact parameters you used. Docker Compose solves all of these problems:
docker-compose.yml alongside your codedepends_on to control start orderThis converter tokenizes your docker run command using the same rules a POSIX shell would apply — respecting quoted strings, backslash escapes, and both --flag value and --flag=value syntaxes. Each recognized flag is mapped to its Compose equivalent:
-p 8080:80 → ports: ["8080:80"]-v /data:/app/data → volumes: ["/data:/app/data"]-e KEY=VALUE → environment: {KEY: VALUE}--restart unless-stopped → restart: unless-stopped--network my-net → networks: [my-net]--cpus 0.5 --memory 512m → deploy.resources.limitsThe converter handles all commonly used flags including port mappings (-p), volume mounts (-v, --mount), environment variables (-e, --env-file), container naming (--name), restart policies (--restart), networking (--network, --dns, --add-host), resource limits (--cpus, --memory), health checks (--health-cmd), capabilities (--cap-add, --cap-drop), logging (--log-driver, --log-opt), devices, tmpfs mounts, security options, ulimits, and more.
Once you have your docker-compose.yml, you can start your service with docker compose up -d and stop it with docker compose down. To add more services, simply append additional entries under the services: key. You can also extract environment variables into a .env file for cleaner secret management.
restart: unless-stopped instead of always so manual stops are respected--link (deprecated) with a shared named network.env file referenced by env_file: rather than hardcoding themmydata:/app/data) instead of bind mounts for portabilityhealthcheck: so Compose knows when a service is truly ready