Docker run → Compose

Paste a docker run command and get a matching docker-compose.yml. Covers the common flags: -p, -v, -e, --name, --restart, --network, -w, --entrypoint, plus the image and any trailing command.

What is Docker run → Compose?

A docker run command with a dozen flags is hard to read, share, or version-control — a docker-compose.yml file captures the same configuration declaratively, in a format that's easy to check into a repo.

How to use it

Paste a docker run command and it's parsed into an equivalent docker-compose.yml, covering ports, volumes, environment variables, restart policy, networks, and the image/command itself.

Example

docker run -d --name web -p 8080:80 -e ENV=prod nginx becomes a compose service block with matching ports, environment, and container_name.