Docker Run to Docker Compose Converter
Convert docker run commands to docker-compose.yml format instantly
All conversion happens in your browser. Your data never leaves your device and is not sent to any server.
Docker Run Command
Quick Examples
docker-compose.yml
Your docker-compose.yml will appear here...
Supported Docker Run Options
Basic Options:
--name- Container name-p / --publish- Port mapping-v / --volume- Volume mounting-e / --env- Environment variables
Network & Runtime:
--network- Network configuration--restart- Restart policy-h / --hostname- Hostname--add-host- Extra hosts
Advanced Options:
--privileged- Privileged mode-u / --user- User-w / --workdir- Working directory--device- Device mapping
Resource Management:
-m / --memory- Memory limit--cpus- CPU limit--cap-add- Add capabilities--cap-drop- Drop capabilities
Process Control:
-d / --detach- Background mode-i / --interactive- Interactive-t / --tty- TTY mode--entrypoint- Entry point
Miscellaneous:
-l / --label- Labels--health-cmd- Health checkcommand- Container command
About Docker Run to Docker Compose Converter
Docker Run to Docker Compose Converter parses your docker run commands and generates equivalent docker-compose.yml configuration files. This tool helps you migrate from imperative docker run commands to declarative docker-compose files, making your container deployments more maintainable and reproducible.
Key features:
- Comprehensive parsing: Supports 30+ docker run options including ports, volumes, environment variables, networks, and resource limits
- Real-time conversion: See your docker-compose.yml output as you type
- Version selection: Generate compose files for different Docker Compose versions (2.4 to 3.8) or omit version for latest Compose (recommended)
- Quick examples: Pre-configured examples for common scenarios (web server, database, Node.js app, cache)
- Export options: Copy to clipboard or download as YAML file
- State persistence: Your last command is saved and restored automatically
Use cases: Converting legacy docker run scripts, documenting container configurations, learning docker-compose syntax, creating reproducible environments, migrating to orchestration platforms