Loading…
Convert docker run commands to Docker Compose YAML files online for free. Simplify container orchestration with this easy migration tool.
Docker Run to Compose is loading — interactive editor will appear here. Use examples below to try instantly once loaded.
Press ? for keyboard shortcuts
Convert docker run commands to Docker Compose YAML files. Parses the command to extract image, ports, volumes, environment variables, network, restart policy, and container name, then generates a complete docker-compose.yml configuration.
Migrating from docker run commands to Docker Compose requires manually translating flags into YAML syntax, which is error-prone; this tool automates the conversion and provides a parsed breakdown of all components.
This tool is part of the DevStackIO platform — a collection of free online developer tools from DevStackIO. Browse more free developer resources on DevStackIO.
DevOps engineers, backend developers, and system administrators who are migrating from standalone Docker commands to Docker Compose orchestration.
Paste your docker run command into the input textarea
The tool parses all flags and displays the extracted components
Review the parsed components: image, ports, volumes, env vars, network, restart policy
Copy the generated docker-compose.yml YAML to your clipboard
The YAML includes a networks section if a custom network was specified
docker run -d -p 8080:80 -e NODE_ENV=prod nginx → service with port mapping and env vardocker run --name db -v /data:/var/lib/postgresql/data postgres:14 → service with named volumedocker run --network backend --restart always redis → service with custom network and restart policyDoes this handle all docker run flags?
It handles the most common flags: -p, -v, -e, --name, --network, --restart, --rm, -d. Some advanced flags may not be parsed.
Can I convert docker-compose.yml back to docker run?
This tool is one-way only. For reverse conversion, consider using docker-compose config.
What about multi-stage builds?
This tool only handles runtime configuration. Build-related settings need to be added manually.
Does the generated YAML include version numbers?
Yes, it uses version 3.8 which is compatible with most Docker Compose installations.
Authoritative specifications, standards, and in-depth reading for Docker Run to Compose.
version: "3.8"
services:
app:
image: nginx:latest
container_name: my-app
ports:
- "8080:80"
volumes:
- "/data:/app/data"
environment:
NODE_ENV: production
networks:
- my-network
restart: unless-stopped
networks:
my-network:
driver: bridgeParsed Components
All parsing is done client-side. Your data never leaves your browser.
Minify JS for production or beautify minified JS for debugging. Use for JS only; for JSON use json-formatter, for CSS use css-formatter. Input: JS text ≤10MB. Returns minified or beautified JS or syntax error. 100% client-side.
Analyze text for word count, readability, and language stats. Paste and get instant insights.
Build JS benchmarks comparing snippets. Use when comparing speed; for regex testing use regex-tester. Input: JS snippets. Returns ops/sec table. 100% client-side, files never leave browser.
Free online JSON formatter and validator with syntax highlighting and error line numbers. Use as default for beautify+validate+minify in one place; for two-file comparison use json-diff, for schema generation use json-schema-generator. Input: JSON ≤10MB. Returns formatted JSON or line-numbered error. 100% private.
Format and validate HTML with indentation and error reporting. Use as default HTML tool; for minifying production HTML use html-minifier, for converting HTML to Markdown use html-to-markdown. Input: HTML ≤10MB. Returns formatted HTML or validation errors. 100% client-side.
Format or minify CSS with indentation control. Use as default CSS tool handling both directions; css-minifier URL is a noindex alias. Input: CSS ≤10MB. Returns formatted or minified CSS. 100% client-side.
Free online SQL formatter with indentation and keyword casing. Format queries privately in browser.
Format and validate XML with indentation and well-formedness checks. Use for XML; for JSON use json-formatter, for XML to JSON conversion use xml-to-json. Input: XML ≤10MB. Returns formatted XML or line-numbered error. 100% client-side.