Paste a literal command, including image and optional container arguments.
Compose Specification YAML (no obsolete version field); validate before deployment.
Paste a literal command, including image and optional container arguments.
Compose Specification YAML (no obsolete version field); validate before deployment.
Docker run to Compose conversion guide
Paste a single literal docker run command to generate a Compose Specification service definition. Supported flags include container name, ports, volumes, environment variables, env files, restart, network and entrypoint. All parsing happens locally; commands are never executed. This tool is free to use. No account or payment is required.
Last updated
The first version maps --name, -p/--publish, -v/--volume, -e/--env, --env-file, --network, --restart, --entrypoint, -i, -t and the container's command arguments. It uses current Compose Specification syntax without an obsolete version field.
The detached -d flag is represented by a warning to use docker compose up -d. Host networking cannot be combined with published ports. Custom networks are treated as external and must exist beforehand.
This tool parses text; it does not invoke a shell, Docker daemon, filesystem or HTTP request. Pipes, substitutions, redirects, unsupported Docker flags, --mount, and --privileged are rejected rather than silently producing incomplete YAML.
Docker CLI argument parsing differs across Bash, PowerShell and CMD. This MVP handles common literal quotes and Windows drive volume paths, but does not interpret arbitrary shell escaping, environment interpolation, or platform-specific mounts.
Common environment secret names are redacted by default; masking is best-effort and does not guarantee all secrets are removed, especially those embedded in commands, images or paths. Never share unreviewed generated YAML.
Literal dollar signs are escaped for Compose interpolation. Referenced env_file paths are not opened and must be supplied alongside your Compose project. The generated file is a starting point, not a validated deployment.
A small docker run command becomes an editable Compose service with the image and port binding retained.
docker run --name demo -p 8080:80 nginx:alpineservices:
"demo":
image: "nginx:alpine"
container_name: "demo"
ports:
- "8080:80"Common questions
No. It only parses literal text locally in the browser. It never runs Docker, Shell commands or network calls.
Common container names, ports, volumes, environment variables, env files, networks, restart policies, entrypoints and commands are mapped. Unsupported options cause an explicit error.
Modern Compose Specification files do not require the old top-level version field.
Common secret-valued environment variables are masked by default. This is best-effort; review all generated output and do not paste credentials into shared documents.
Not in this MVP. These cases are rejected instead of generating YAML that could silently change behavior.
Debugging a specific YAML issue? Browse YAML troubleshooting.