Docker Run to Compose
Convert docker run commands into docker-compose.yml service definitions.
Runs locally in your browser. Your input is not uploaded.
How to Use
- 1
Paste the docker run command
Multi-line commands with backslash continuations are handled.
- 2
Review the YAML
Ports, volumes, environment, and restart policy map to compose keys; unmapped flags appear in a comment.
- 3
Save and run
Save as docker-compose.yml and start with docker compose up -d.
Frequently Asked Questions
- It parses the command's flags — ports (-p), volumes (-v), environment (-e), name, restart policy, network, workdir, user, entrypoint — and maps each to the equivalent docker-compose service key.
Related Tools
CSS FormatterMinify or beautify CSS stylesheetsJS FormatterMinify or beautify JavaScript codeHTML FormatterBeautify or minify HTML markupHTML EscapeEscape special HTML characters to entitiesHTML StripperRemove all HTML tags to extract plain textHTML EntitiesSearchable reference for all HTML entity codesSQL FormatterBeautify and format SQL queriesXML FormatterFormat, validate, and minify XML documents instantly