Docker to Compose
Convert docker run commands to docker-compose.yml files.
Docker Run Command
Convert a single docker run command without executing it. Unsupported flags produce an actionable error.
Quoted arguments and backslash line continuations are supported. Input stays in your browser; nothing is executed.
Named volumes and custom networks are declared external to preserve existing Docker resources. Create them first if needed. Docker --rm and detach flags concern invocation and are omitted; use docker compose run --rm or up -d as needed. Dollar signs are escaped to preserve literal values.
Validate the file before use: docker compose config
docker-compose.yml
services:
web:
container_name: web
restart: unless-stopped
image: nginx:alpine
ports:
- "8080:80"
volumes:
- ./html:/usr/share/nginx/html:ro
environment:
- NGINX_HOST=example.com
12 lines223 bytescompose.yaml