Docker Run to Compose
Convert docker run commands to docker-compose.yml format instantly. Free online Docker Compose converter with YAML output.
Output will appear here...
What is Docker Run to Compose?
Docker Compose is a tool for defining multi-container applications in a single YAML file. Converting from docker run commands to docker-compose.yml makes your container setup reproducible, version-controlled, and easier to share. This tool parses docker run flags and generates the equivalent Compose configuration.
How to Use
- Paste your docker run command in the input area
- The docker-compose.yml output appears instantly
- Supported flags: -p, -v, -e, --name, -d, --restart, --network, -w, -u, and more
- Download the output as docker-compose.yml
Examples
Simple web server
With environment and restart
Related Tools
JSON Formatter & Minifier
Format, beautify, and minify JSON online. Free JSON formatter with syntax validation and error highlighting.
YAML to JSON Converter
Convert YAML to JSON and vice versa. Free online YAML/JSON converter with syntax validation and pretty-print.
SQL Formatter
Format and beautify SQL queries online. Free SQL formatter supporting MySQL, PostgreSQL, SQL Server, and more. Instant conversion.
CSS Minifier & Beautifier
Minify CSS to reduce file size or beautify CSS for readability. Free online CSS minifier with size comparison and instant conversion.
Frequently Asked Questions
Which docker run flags are supported?
-d, --name, -p/--publish, -v/--volume, -e/--env, --restart, --network/--net, -w/--workdir, -u/--user, -h/--hostname, --privileged, --add-host. Unsupported flags are ignored.
Does it handle multiple services?
Currently it converts one docker run command at a time. For multiple services, convert each separately and merge the services section manually.
What Compose version does it generate?
It generates Compose v3 format without an explicit version field (as recommended by modern Docker Compose).