Skip to main content
FreeOnlineTools Go
English

Docker Run to Compose Converter

Convert docker run commands into docker-compose.yml format. Parses flags, ports, volumes, env vars, and more. Runs entirely in your browser.

Local processing

What is Docker Run to Compose Converter?

docker-compose.yml is a declarative configuration file for multi-container Docker applications. Converting from imperative docker run commands makes configurations reproducible and version-controllable.

How It Works

The tool tokenizes the docker run command, maps each flag to its compose equivalent (ports, environment, volumes, restart, network, etc.), and outputs a YAML structure with version 3.8.

Common Use Cases

  • Migrating from docker run scripts to compose files
  • Documenting container configurations
  • Simplifying multi-container setups

Technical Details

Supported flags: --name, -p, -e, -v, --restart, --network, -w, -u, -h, -d, --rm, -it. Output: YAML version 3.8 format.

How to Use

  1. Paste a docker run command
  2. Click Convert
  3. Copy the resulting docker-compose.yml

Privacy

All processing happens in your browser. Your data is never uploaded to any server.

FAQ

What flags are supported?

--name, -p/--publish, -e/--env, -v/--volume, --restart, --network, -w/--workdir, -u/--user, -h/--hostname, and the image + command.

Related Tools