docker run to docker-compose

Paste one or more docker run commands and get a docker-compose.yml with the services, named volumes and networks. It flags the options that cannot be translated. The command is never run.

Your data stays on your computer. Files are processed in your browser and are never uploaded.

The share link contains the commands, including any passwords in environment variables: do not share it if there are secrets.

What is translated

Image, name, ports, volumes and mounts, environment variables, restart, networks, user, directory, entrypoint and command, capabilities, memory and CPU limits, healthcheck, logging, hosts and DNS, ulimit, sysctl, -it and other common options. Several commands become several services.

Volumes and networks

Named volumes are also added to the volumes section. Custom networks are declared external: they must already exist. Directories (bind mounts) stay as paths, relative to the compose file when they start with ./.

Privacy

The conversion happens in your browser: the commands, with any secrets, are not sent to any server.

Keyboard shortcuts

In this tool

This tool has no keyboard actions.

Everywhere

Open this panel (outside text fields)
?
Closes panels and menus, never clears data
Esc
Search for a tool
/ or CtrlK

How to use it

  1. Paste one or more docker run commands, also on several lines with a backslash.
  2. Check the generated docker-compose.yml and the warnings about options that were not translated.
  3. Copy or download it and start it with docker compose up -d.

Frequently asked questions

Why is there no "version:" line?

Docker Compose v2 considers it obsolete and warns when it is present: the file starts directly with "services:".

What happens to --rm?

Compose has no equivalent option for services. For a throwaway container use docker compose run --rm, while docker compose down removes the project's containers.

Why are the networks "external"?

A docker run command uses a network that usually already exists (for example the reverse proxy's). Declaring it external makes compose use it without creating it; if you want compose to create it, remove "external: true".

Can I paste several commands?

Yes, one per line or separated by ; or &&: each command becomes a service, named after --name or the image. Commands that are not docker run are skipped with a warning.

Are my commands sent to a server?

No: the conversion happens in your browser.

Tool chains

Link several tools into a path: after using a tool, “Send to…” offers the next step first. Saved chains keep only a name and the tools, never your data.

Saved chains

No saved chains.

New chain