Docker Run to Compose Converter
Turn any docker run command into a ready-to-use docker-compose.yml file, right in your browser.
docker-compose.yml
Paste a docker run command above โ the Compose file appears instantly.
Notes
How it works
Paste a docker run command and this converter parses it exactly like a shell
would โ quotes, \ line continuations and combined short flags such as
-it all work โ then maps every flag to its Docker Compose equivalent:
-p becomes ports, -v becomes volumes,
-e becomes environment, --restart,
--network, --health-cmd, --log-opt,
--ulimit and dozens more are handled too. Named volumes and networks it finds
are declared at the top level so the file is ready to run with
docker compose up -d. Flags with no Compose counterpart (like
--rm) are listed under Notes instead of being silently dropped. Everything is
parsed in your browser with JavaScript โ your commands, tokens and environment variables
are never uploaded.
Frequently asked questions
How do I convert a docker run command to docker-compose.yml?
Paste the full docker run command into the box and the Compose file appears instantly below it. Every flag is mapped to its Compose equivalent: -p becomes ports, -v becomes volumes, -e becomes environment, --name becomes container_name, and so on. Copy the YAML or download it as docker-compose.yml, then start it with docker compose up -d.
Is it safe to paste a docker run command with secrets in it?
Yes. The converter is pure JavaScript running in your browser - nothing is sent to a server, logged or stored, so API tokens and passwords in -e flags stay on your device. You can even load the page once and keep using it offline.
Which docker run flags are supported?
About sixty, including -p, -v, --mount, -e, --env-file, --name, --restart, --network, -w, -u, --entrypoint, --add-host, --cap-add, --device, --dns, --label, --log-driver, --log-opt, --ulimit, --sysctl, --tmpfs, --memory, --cpus and the full --health-* set. Flags with no Compose equivalent, such as --rm or -d, are listed under Notes instead of being silently dropped.