Developer Tools

Docker Run to Compose — YAML Converter

Convert docker run commands into docker-compose.yml locally in your browser, recognizing ports, volumes, environment variables, and images. Useful for turning one-off runs into reusable compose files.

DockerComposeYAML

Favorite this tool

No favorite storage mode has been selected.

Quick actions

Copy this tool URL or open the system share sheet on a supported device.

Use cases

  • Turn demo docker run commands into compose files
  • Organize -p, -v, and -e flags into service definitions
  • Share self-hosted app startup config with the team

How to use

  1. Paste a full docker run command
  2. Review the generated compose YAML
  3. Copy or export the compose file

Example input and output

docker run

docker run -d -p 8080:80 --name web nginx:latest

compose snippet

services:
  web:
    image: nginx:latest
    ports:
      - "8080:80"

FAQ

Are all docker run flags converted?

Common ports, volumes, env vars, names, and images are covered. Rare or legacy flags may be skipped and need manual review.

Which Compose version is emitted?

The output is a usable docker-compose.yml structure. Add version fields if your team requires a specific convention.

Tools

Related tools

Continue with another translated tool for a nearby task.

Dockerfile Generator

Dockerfile Generator — Multi-language Build Templates

Available

Generate Dockerfiles for Node, Python, Go, and related stacks with optional multi-stage builds, non-root users, timezone packages, and a matching .dockerignore starter.

Docker Dockerfile Container

Docker Compose Generator

Docker Compose Generator — Compose File Builder

Available

Select App, Nginx, database, and cache services to generate a local docker-compose.yml with ports and common dependency combinations for dev or demo environments.

Docker Compose Orchestration Container

YAML to JSON

YAML to JSON Converter Online

Available

Convert YAML to formatted JSON in your browser with two-space indentation by default. Parse failures show the reason, and conversion stays local—useful for config debugging and API handoffs.

YAML JSON Converter