Docker Run to Compose
Convert a docker run command into a docker-compose.yml service with ports, volumes, environment variables, restart policy, networks and the command. Free tool.
Runs in your browser. Nothing is uploaded.
About Docker Run to Compose
A long docker run command is hard to maintain. Paste it here and get the equivalent docker-compose.yml service: -p ports, -v volumes, -e environment variables, --name, --restart, --network, -w, -u and the image's command all map to their Compose keys.
Compose files can be committed to version control and started with a single docker compose up, which makes them the better home for any container you run more than once.
How to use Docker Run to Compose
- Type or paste your text into the input box. Press Sample to see an example.
- The result appears instantly as you type.
- Copy the result, or press Use as input to chain another transformation.
Frequently asked questions
Does it handle named volumes?
Yes. Named volumes (pgdata:/data) are mapped, and you should also declare them under a top-level volumes: key.
What about -d and --rm?
They're runtime flags with no Compose equivalent. Use docker compose up -d to run in the background.
Is Docker Run to Compose free and private?
Yes. Docker Run to Compose is completely free with no sign-up. Everything runs in your browser, so whatever you type or paste never leaves your device.