DevTulz Online

docker run command
docker-compose.yml
Examples:

What is Docker Compose?

Docker Compose is a tool for defining and running multi-container Docker applications using a YAML file (docker-compose.yml). Instead of running long docker run commands with many flags, you describe your service configuration declaratively in a file and start everything with docker compose up. This makes it easy to version-control your container configuration, share it with teammates, and reproduce environments consistently. This tool converts a docker run command into the equivalent Compose service definition, handling ports (-p), environment variables (-e), volumes (-v), restart policies (--restart), networks (--network), resource limits (--memory, --cpus), labels, capabilities, healthchecks, logging, and more.

How to Use Docker Run to Compose

  • Paste your full docker run command into the input box (including 'docker run').

  • The docker-compose.yml output is generated instantly as you type.

  • Click one of the example buttons to load a pre-built example command.

  • Review the generated YAML β€” named networks are output with 'external: true' as a starting point.

  • Click Copy to copy the YAML to your clipboard, then save it as docker-compose.yml.