Docker Run to Compose Converter
Paste a docker run command and get a ready-to-use docker-compose.yml service — ports, volumes, environment variables, restart policy, networks and more, parsed instantly.
Examples
docker-compose.yml
version: "3.8"
services:
web:
image: nginx:1.27
container_name: web
ports:
- 8080:80
environment:
- TZ=UTC
- -d (detach) was dropped: Compose runs services in the background by default.
About this converter
This tool parses the common docker run flags — image, --name, -p/--publish, -v/--volume, -e/--env, --restart, --network, -w/--workdir, --entrypoint and a trailing command — and emits a valid Compose v3 file. Unknown flags are skipped with a notice rather than failing, so a partial command still produces useful YAML. Everything runs locally in your browser; nothing is uploaded.