docker run to Compose
Convert a docker run command into a docker-compose.yml service, or the other way round.
docker run to Compose
Paste a docker run command and this tool rewrites it as a docker-compose.yml service, with the image, ports, volumes, environment variables, network and restart policy mapped to their compose equivalents. Flip the direction option and it works the other way too: paste a compose file and get back the equivalent docker run command for each service, useful when you only have a compose file but need to reproduce one container manually.
Paste more than one docker run command, one per line, and each becomes its own service in the same compose file — handy for turning a handful of ad-hoc containers into a proper multi-service stack. Recognized switches include -p/--publish, -v/--volume, -e/--env, --network, --restart, --memory and --cpus (mapped to a deploy.resources.limits block), plus --name, --workdir, --user, --entrypoint, --label and --hostname. Environment variables can stay inline under environment: or be moved into a generated .env file referenced with env_file:, and the compose file format can be written with or without a version: key.
Not every docker run flag has a compose equivalent — things like --rm or --pull are container lifecycle switches with no per-service compose setting. The tool never drops them silently: unsupported flags are listed as comments next to the service they belong to, so you can see exactly what didn't carry over. Turning off "preserve original flag order" sorts each list (ports, volumes, environment) alphabetically instead of keeping the order you typed them in, which can make a generated diff easier to review.
Everything runs locally in your browser — no command, image name or environment variable is ever sent anywhere. Copy the result, download it as a .txt file, or send the output back into the input to keep refining it.