Docker Run → Compose Converter
Paste a docker run command and get a ready-to-use docker-compose.yml. Supports ports, volumes, env vars, networks, and more.
Paste a docker run command and get a ready-to-use docker-compose.yml. Supports ports, volumes, env vars, networks, and more.
Docker Compose makes it easy to define, configure, and run multi-container Docker applications. While docker run commands work fine for quick tests, Compose files are easier to maintain, version-control, and share. You can run your entire stack with a single docker compose up command.
This tool parses your existing docker run command and converts it to a well-formatted docker-compose.yml — saving you from having to manually translate each flag.
docker run command, including all flags.docker-compose.yml in your project.The tool supports the most commonly used flags: -p (ports), -v (volumes), -e (environment variables), --env-file, --name, --network, --restart, --cpus, --memory, and -d. Unrecognized flags are shown in a warning so you can handle them manually.
The output uses version "3.8" which is widely supported. If you need resource limits (--cpus, --memory), they are placed in the deploy.resources block which requires Compose v3 with Docker Swarm mode, or Docker Compose v2+ with --compatibility flag.
Currently the tool converts one command at a time. For multi-container setups, convert each command separately and combine the resulting services into a single docker-compose.yml file manually.