Guide

THE TOOLBOX / DEVOPS & CONTAINER UTILITIES

Docker Run ↔ Compose,
clean YAML in one paste.

Convert docker run commands to Docker Compose YAML or JSON, and translate multi-service docker-compose.yml files back into standalone docker run shell scripts locally in your browser.

Presets
1 line · 160 chars

160 / 50,000 UTF-16 code units · 160 UTF-8 bytes

100% browser-local POSIX parser

Converted docker run to valid Docker Compose YAML.

15 lines · 281 chars

THE DETAILS

Docker CLI flags to Compose directive mapping.

Docker CLI FlagCompose DirectiveExample YAML
-p, --publishports- "8080:80"
-v, --volumevolumes- pgdata:/var/lib/postgresql/data
-e, --envenvironment- NODE_ENV=production
--namecontainer_namecontainer_name: web
--restartrestartrestart: unless-stopped
--cpus, --memorycpus, mem_limitcpus: "1.5", mem_limit: 512m
--health-cmdhealthcheck.test["CMD-SHELL", "curl -f http://localhost/"]

Frequently Asked Questions

How does Docker Run to Docker Compose conversion work?

The converter tokenizes your shell command using POSIX lexical parsing rules, extracts flags (ports, volumes, environment variables, resource limits, and health checks), and maps them into valid Docker Compose YAML or JSON.

Can I convert multiple docker run commands into a single multi-service compose file?

Yes. Paste multiple docker run commands separated by newlines (including multi-line backslash continuations). Each container becomes a service under services, and named volumes are automatically declared under top-level volumes.

Can I convert docker-compose.yml back into docker run commands?

Yes. Switch to "Compose → docker run" or click Swap ↔ to translate single- or multi-service Compose YAML/JSON into properly quoted docker run shell commands.

Are named volumes and environment dictionaries supported?

Yes. The converter handles both list syntax (-e KEY=val) and key-value dictionary syntax (KEY: val), and automatically detects named volume mounts like pgdata:/var/lib/postgresql/data.

Are my environment variables or secrets sent to a server?

Never. The lexical tokenizer and YAML parser execute 100% locally in your browser memory—no commands, passwords, or internal image names ever leave your device.