Docker run to Docker compose converter

Transforms "docker run" commands into docker-compose files!

About Docker run to Docker compose converter

Translates a docker run command into an equivalent docker-compose.yml service definition, mapping ports, volumes, environment variables, restart policy, networks and the other common flags, using the composerize library.

When you would use it

How to use it

  1. Paste the complete docker run command, including the image name.
  2. Read the generated Compose file on the right.
  3. Check the notices below it for flags that could not be translated, then copy the result.

Things worth knowing

Frequently asked questions

Why does the output not include a version key?
Recent versions of Docker Compose treat the version field as obsolete and ignore it. The generated file follows the current Compose specification, which does not need it.
How do I start the stack?
Save the output as docker-compose.yml (or compose.yaml) and run docker compose up -d in the same directory. docker compose down stops and removes the containers.

All the tools