Make Tools
🐳

Docker Run to Docker Compose

Convert docker run commands to docker-compose.yml format. Automatically parses ports, volumes, environment variables, image names, and more.

Frequently Asked Questions

What flags are supported?
The converter supports -p (ports), -v (volumes), -e (environment), --name, --restart, --network, --hostname, --privileged, -it, -d, and -l (labels).
What about --rm?
The --rm flag has no equivalent in docker-compose as containers are automatically cleaned up on stop when using compose.
Does it handle multi-line commands?
Yes, commands split across multiple lines with backslashes are properly joined before parsing.

Related Tools

How to Use

  1. 1 Paste a `docker run` command into the input area.
  2. 2 The tool parses ports (-p), volumes (-v), environment variables (-e), and more.
  3. 3 View the generated docker-compose.yml with proper YAML structure.
  4. 4 Copy the compose file and use it with `docker-compose up`.