UFOZoo

Docker Compose to Run — Convert compose.yml to docker run

Convert docker-compose.yml to docker run commands instantly. Supports ports, volumes, env vars, networks, restart policies. Free browser tool, no data uploaded.

Features

  • Instant conversion — paste a docker-compose.yml and get docker run commands in real time
  • Supports all common compose options: ports, volumes, environment, restart, network_mode, container_name
  • Handles volume mount modes — bind mounts, named volumes, read-only (:ro), and read-write
  • Converts environment variables from both list and map formats to -e flags
  • Preserves restart policies — always, unless-stopped, on-failure, no
  • Generates clean, copy-paste ready docker run commands with proper flag ordering
  • Handles multi-service compose files — outputs one docker run per service
  • Adds -d (detach) flag by default for background execution
  • One-click copy all commands to clipboard or download as a shell script
  • Entirely client-side — your compose files never leave the browser
  • Supports compose v1, v2, and v3 format syntax
  • Shows detected services count and total command length in the status bar

How to Use

  1. 1Paste your docker-compose.yml content into the input area — docker run commands appear instantly.
  2. 2The tool detects all services and generates a separate docker run command for each one.
  3. 3Click the Copy button to copy all generated commands to your clipboard.
  4. 4Download as a .sh shell script with the Save button for easy execution.
  5. 5Use the Clear button to reset both input and output for a new conversion.
  6. 6Try the example buttons below the input to see common conversion scenarios.
  7. 7Named volumes in the compose file are noted — you may need to create them separately with docker volume create.
  8. 8The tool adds -d flag by default so containers run in the background.
  9. 9For compose files with depends_on, check the original file and run commands in dependency order.

Frequently Asked Questions

What is docker compose to docker run conversion?

It converts docker-compose.yml service definitions into individual docker run CLI commands. Each service in the compose file becomes a separate docker run command with all its options (ports, volumes, environment variables, etc.) mapped to the corresponding CLI flags. This is useful when you need to run a single service without compose, debug a specific container, or migrate between orchestration tools.

What compose options are supported?

The tool supports all common compose options: image, container_name, ports, volumes (bind mounts and named volumes with :ro/:rw modes), environment (both list and map formats), restart policy (always, unless-stopped, on-failure, no), network_mode (host, bridge, none), command, working_dir, and user. Less common options are preserved as comments.

How are named volumes handled?

Named volumes (e.g., pgdata:/var/lib/postgresql/data) are converted to -v pgdata:/var/lib/postgresql/data flags. The tool also outputs a separate docker volume create command for each named volume, since docker run won't auto-create named volumes like docker compose does.

Does it add the -d (detach) flag?

Yes, by default all generated commands include the -d flag to run containers in the background, matching the typical docker compose behavior where services run detached. This matches what most users expect when converting from compose to run commands.

How does it handle multiple services?

Each service in the compose file generates a separate docker run command. Services are output in the order they appear in the compose file. If your compose file uses depends_on, you should run the commands in dependency order (e.g., database before application).

What about depends_on?

The decomposerize library does not currently preserve depends_on information in the output. You should manually check your compose file for depends_on directives and run the commands in the correct order — for example, start the database before the application that connects to it. Docker compose handles this automatically, but with docker run you manage the order manually.

Can I convert compose files with networks?

Yes. Custom networks defined in the compose file are noted, and services using network_mode: host, bridge, or none are converted with the --net flag. For custom bridge networks, you may need to create the network first with docker network create.

Is my data safe and private?

Yes. All conversion happens entirely in your browser using JavaScript. Your compose files are never sent to any server. The tool works offline after the initial page load. This is safe for sensitive configurations that may contain passwords, API keys, or internal hostnames.

What's the difference between this and docker compose run?

docker compose run is a compose subcommand that runs a one-off command from a compose file. This tool converts the compose file into standalone docker run commands that don't require compose at all. Use this when you want to run containers without the compose CLI installed, or when you need to embed container startup in scripts.

Does it support compose v2 and v3?

Yes. The tool handles compose files in v1 (with version field), v2, and v3 formats. It also works with the modern 'Common Specification' format that doesn't include a version field. The conversion logic is the same regardless of the compose format version.

Can I use this on mobile?

Yes, the tool works on mobile browsers. However, for the best experience with large compose files, we recommend using a desktop browser where you can easily review the generated commands side by side with the input.

Related Tools