Docker Run → Docker Compose Converter

Docker Run → Compose Converter

docker run command
docker-compose.yml
Paste a full docker run command and get a valid docker-compose.yml. Supports -p, -e, -v, –name, –restart, –network, –hostname, –user, –cap-add, –device, –label and more.

Why switch from docker run to Compose?

Starting a container with a long docker run command quickly becomes hard to manage. A docker-compose.yml is version-controllable, readable and can be started reproducibly with docker compose up -d.

This converter parses your docker run command and builds the matching Compose format – including ports, volumes, environment variables, restart policy, network and more. Everything runs entirely in your browser.

Supported options

  • -p/--publish → ports, -v/--volume → volumes
  • -e/--env → environment, --name → container_name
  • --restart, --network, --hostname, --user, --privileged
  • --cap-add, --device, --label plus the image and command
  • See also: our Docker Compose Generator to build one from scratch
Scroll to Top