Docker Run to Compose Converter
Free, private, 100% client-side.
Loading tool...
What is Docker Run to Compose Converter?
Docker Run to Compose Converter is a free online tool that turns docker run commands into Docker Compose service definitions. Paste the command you already use β from shell history, a README, or a CI pipeline β and get a clean YAML block with image, container name, ports, volumes, environment variables, restart policy, healthchecks, logging, and more mapped to their Compose keys.
Key Benefits
- Migrate legacy docker run scripts to compose files in seconds
- Automatic mapping of 40+ flags eliminates manual translation errors
- Notes section flags options that need a manual decision
- Private by design β commands never leave your browser
Common Use Cases
- β’Convert a long docker run command from a wiki page into a compose service
- β’Move one-off containers into a version-controlled docker-compose.yml
- β’Prepare services for docker compose up during local development
- β’Standardize how your team defines containers across projects
How to Convert docker run to docker-compose.yml
- Paste the command: Copy the full docker run (or docker create) command, including multi-line backslashes, into the input box.
- Review the YAML: The docker-compose.yml output appears automatically with service name, image, ports, volumes, and environment mapped from your flags.
- Handle the warnings: Read the notes for manual review β each item is a flag the converter could not map confidently, so add or adjust it by hand in the YAML.
- Copy or download: Press Copy or Download to save docker-compose.yml, then run docker compose up -d to verify it behaves like the original command.
Key Features
- Maps 40+ docker run flags to Compose service keys
- Correct shell tokenizing: quotes, escapes, and line continuations
- Combined short flags like -it are expanded automatically
- Healthcheck, logging, cap-add, devices, and tmpfs support
- Copy or download the generated docker-compose.yml in one click
- Runs entirely in your browser β no data is transmitted