Docker run → Compose converter
Paste a docker run command and get a matching compose.yaml service — ports, environment, volumes, restart policy, network, working directory, user, entrypoint, and command.
Your command never leaves the browser — no upload, no server.
Input
Could not parse command
Warnings
Unsupported flags
Compose output
About this tool
docker run is great for one-off containers. When you need the same setup again — same ports, env vars, volumes — a Compose file is easier to version and share. This converter tokenizes your shell command (quotes and escapes included) and maps common flags to Compose fields.
Runtime-only flags like --rm and -P have no Compose field, so they show up as warnings. --env-filebecomes env_file, and named volumes get the top-levelvolumes: entry Compose requires. Flags such as resource limits, devices, GPUs, health checks and capabilities have Compose fields with a different shape, so they're listed as unsupported for you to translate by hand. Always review the generated YAML before deploying.
Read more
- Introduction to Docker Compose
- Tool tutorials — including how to convert docker run to Compose
- First steps with Docker
- An introduction to Docker Containers
- Dockerfiles
- Docker Images
Free books, courses, and software
Get my programming books, course editions, and complete software.
Get the download library →