Convert docker run commands to docker-compose.yml format instantly.
version: '3'
services: myapp:
image: nginx:alpine
ports: - '8080:80'
volumes: - './html:/usr/share/nginx/html'Send HTTP requests (GET, POST, PUT, DELETE) and inspect responses from your browser.
WebSocket TesterConnect to WebSocket endpoints, send messages, and inspect frames.
HTTP Status Code ReferenceSearchable reference of all HTTP status codes with descriptions and use cases.
Request BuilderBuild HTTP requests interactively and generate code snippets in multiple languages.
curl to Fetch ConverterConvert curl commands to JavaScript fetch, Python requests, and more.
OpenAPI ValidatorValidate OpenAPI 3.x and Swagger 2.0 specifications for correctness.
Mock API GeneratorGenerate mock API responses from JSON schemas for rapid development.
Docker → ComposeConvert docker run commands to docker-compose.yml format instantly.
Fake Data GeneratorGenerate realistic fake data including names, emails, phone numbers, addresses, and more.
Docker Run to Compose Converter is a free online tool that helps you convert docker run commands to docker-compose.yml format instantly. With Flag Mapping: maps all common docker run flags to compose equivalents: ports (-p), volumes (-v), env (-e), networks, restart policies, healthchecks, and more. Real-Time Conversion: see the compose yaml update live as you edit the docker run command ã¢â‚¬â€ no button clicking needed, the tool makes api tasks straightforward and efficient. Every operation runs locally in your browser — your data stays private and never leaves your device.
Docker → Compose processes everything on your device, eliminating the need for server uploads or software installation. This approach is particularly useful for migrating docker run based development setups to docker-compose.yml converting one-off docker run commands from documentation to reusable compose files. Whether you need flag mapping or more advanced api operations, Docker → Compose delivers reliable results without compromising on security or performance.
It supports all commonly used flags including -p, -v, -e, --name, --restart, --network, -d, -it, --rm, --memory, --cpus, --env-file, -w, -u, --entrypoint, --label, --expose, --add-host, --platform, --health-cmd, and more.
Docker run -p 8080:80 becomes ports: ['8080:80'] in compose. Multiple -p flags produce multiple port entries.
Docker run -v ./data:/app/data becomes volumes: ['./data:/app/data']. Named volumes, bind mounts, and volume drivers are all preserved.
Yes. Both -e VAR=value and -e VAR (without value, using host env) are supported. --env-file is mapped to env_file in compose.
No. All parsing and conversion happens locally in your browser. Your commands are never transmitted or stored.
This tool converts a single docker run command to a single service in docker-compose.yml. For multi-container setups, convert each command separately and combine the services.
The generated compose file uses version 3 syntax which is compatible with modern Docker Compose (v2) and Docker Swarm.
Maps all common docker run flags to compose equivalents: ports (-p), volumes (-v), env (-e), networks, restart policies, healthchecks, and more.
See the compose YAML update live as you edit the docker run command  no button clicking needed.
Invalid docker run commands are flagged with clear error messages so you can fix and retry.
All parsing happens locally in your browser. Your docker commands never leave your device.
Docker Run to Compose Converter is useful in a variety of scenarios across different workflows:
Migrating docker run based development setups to docker-compose.yml
Converting one-off docker run commands from documentation to reusable compose files
Standardizing local development environments with version-controlled compose files
The --name flag becomes the service name in compose. Without it, the service name is derived from the image name. Always use --name for clarity.
The --restart flag maps to the restart policy in compose. 'unless-stopped', 'always', 'on-failure', and 'no' are all supported.
Explore more api tools to enhance your workflow:
REST API Client
Send HTTP requests (GET, POST, PUT, DELETE) and inspect responses from your browser.
curl to Fetch Converter
Convert curl commands to JavaScript fetch, Python requests, and more.
Request Builder
Build HTTP requests interactively and generate code snippets in multiple languages.
WebSocket Tester
Connect to WebSocket endpoints, send messages, and inspect frames.
HTTP Status Code Reference
Searchable reference of all HTTP status codes with descriptions and use cases.
OpenAPI Validator
Validate OpenAPI 3.x and Swagger 2.0 specifications for correctness.
Deepen your knowledge with these api guides and tutorials: