Docker Compose Converter
Convert docker run commands to docker-compose YAML and back. Supports volumes, ports, env, networks, restart policies. Runs in your browser.
Reference
How does the Docker Compose converter work?
docker run → compose: tokenizes the command-line, maps flags to compose keys (-p → ports, -v → volumes, -e → environment, --name → service name, --restart → restart policy), and emits valid docker-compose.yml. compose → docker run: parses YAML and reconstructs the docker run command for each service.
Supported flags
-p/--publish— port mappings-v/--volume— bind mounts and named volumes-e/--env— environment variables--name— container name → service name--restart— restart policy--network,-d,--rm,--entrypoint,-w,-u
Common uses
- Onboarding — turn a tutorial's docker run command into a maintainable compose file.
- Refactoring — migrate from docker run scripts to compose-managed stacks.
- Documentation — show both forms side by side.
Privacy
All conversion runs 100% in your browser. No data is sent to any server.