docker run to compose — convert a command to a compose file
Paste a docker run command and get an equivalent docker-compose.yml. It converts entirely in your browser (0 uploads, works offline).
How to use it
- Paste your
docker runcommand. - The compose file appears live.
- Copy or Download
docker-compose.yml.
FAQ
How do I convert docker run to docker-compose for free?
Paste the command and this page maps its flags — published ports, environment variables, volumes, container name and restart policy — into a compose service, on your device with no upload.
Which flags are supported?
-p/--publish, -e/--env, -v/--volume, --name, --restart, the image name and a trailing command. Run-only flags like -d and --rm are recognised and skipped.
Is my command uploaded anywhere?
No. The conversion runs entirely in your browser and nothing is transmitted or stored, which you can verify by turning off your Wi-Fi.
Can I convert a multi-container setup?
This converts a single docker run into one service. Combine several outputs under one services: block to describe a multi-container stack.
Limits
Maps the common run flags into one service; networks, healthchecks and depends_on are not inferred.
Related
The API spec generator scaffolds OpenAPI; the cURL-to-code tool converts requests.
Bookmark this page (Ctrl+D, or ⌘D on Mac) or install the app — it works offline the next time you need it.