devpocket.dev

Docker Run to Compose

Convert one or more docker run commands into a Compose YAML service file.

Runs locally
Loading tool…

How to use

Paste one or more docker run commands, one per line. Backslash line continuations, shell quotes, and escaped spaces are supported. The generated Compose file includes ports, volumes, environment variables and files, names, restart policy, networks, working directory, entrypoint, user, labels, capabilities, memory, CPUs, image, and command.

Review warning cards before using the result: unsupported Docker flags are deliberately omitted rather than guessed.

FAQ

Can I convert several containers at once?

Yes. Put each docker run command on its own line. Each becomes a service, and duplicate image-derived names receive a numeric suffix.

Why are -d and -it omitted?

Compose controls attachment and interactive execution at invocation time, so those docker run terminal flags do not belong in the service definition.

Related tools