Docker Run to Compose
100% LocalConvert docker run commands to docker-compose.yml format.
Paste a docker run command. Ports, volumes, env vars, and networks parse into Compose YAML.
Learn More
Docker Compose Secrets: Stop Putting Credentials in docker-compose.yml
Dockerfile Performance: Best Practices for Fast & Small Images
Learn how to optimize your Docker images for speed and size. From multi-stage builds to layer caching, this guide covers the production secrets of high-performance containers.
Configuration Mastery: Taming the YAML vs. JSON vs. TOML War
What is Docker Run to Compose?
Frequently Asked Questions
Technical Deep Dive
Docker Run to Compose
Paste any docker run command and get a clean docker-compose.yml file. Parses ports, volumes, environment variables, networks, labels, and more. Includes example presets for popular services.
docker run to compose
Translates a long docker run line into a docker-compose.yml service, mapping -p, -v, -e, --network, restart, and more.
Readable YAML
Output is ordered and commented where a flag needs explaining, so it drops straight into a repo.
Local conversion
The command — often with env values or mount paths — is parsed in the browser.
01 Flag-to-Compose Mapping Matrix
| Docker Run Flag | Compose Key | Behavioral Note |
|---|---|---|
-p / --publish | ports | Host-to-container mapping |
-v / --volume | volumes | Bind mounts and named volumes |
-e / --env | environment | Inlined as key-value pairs |
--restart | restart | Policies (e.g., unless-stopped) |
--network | networks | Auto-generates external definitions |