Skip to content
gohacks.dev
DevOps

Docker Compose to docker run Converter

Convert a compose.yaml into equivalent docker run commands: ports, volumes, environment, env files, healthchecks, resource limits and a shared network.

Free · No sign-up · Your inputs stay in your browser

Input

Convert Docker Compose to docker run

Output

docker run

2 services

Services are started in depends_on order on a user-defined network, where each one is reachable by its service name as Compose would make it. depends_on conditions such as service_healthy have no docker run equivalent: start the next container once the first reports healthy.

Runs in this browser. Nothing you paste is sent to a server.

When you need it

A host without the Compose plugin, a CI step that runs one container, a tool that only accepts a docker run line, or simply understanding what Compose does for you. It is the reverse of the docker run to Compose converter.

What has no equivalent

depends_on with condition: service_healthy has no flag: start the next container once docker inspect --format '{{.State.Health.Status}}' reports healthy. build sections need a separate docker build. Named volumes are created first, as Compose would, and the docker run reference lists every flag.

Share

Frequently asked questions

How do containers find each other without Compose?
Put them on the same user-defined network with docker network create and --network; each container is then reachable by its name or --network-alias, just as Compose service names are.
Does docker run read the .env file like Compose?
No. Compose uses .env for variable substitution in the YAML. With docker run, pass variables with -e or --env-file explicitly.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools