All tools Developer

Docker Run to Compose

Convert a docker run command into a docker-compose.yml service.

    Notes
    • Flags like -d, --rm or --pull are listed above instead of being silently dropped.
    • Named volumes get a top-level volumes: entry with name: so Compose reuses the existing volume.
    • --network host / none becomes network_mode on the service.
    • Everything runs locally in your browser — your commands are never uploaded.

    Runs in your browser. Nothing you open or type here is uploaded.

    How to use

    1. Paste one or more docker run commands.
    2. Click Convert.
    3. Read the generated docker-compose.yml and check the warnings list.
    4. Copy the YAML, or download it as compose.yaml.

    Details

    The converter reads a docker run command line and rewrites it as a Compose service in YAML. Ports, environment variables, volumes, mounts, networks, restart policies, resource limits, logging, healthchecks, labels, capabilities, user, hostname, extra hosts, stdin/tty and privileged mode are all mapped to their Compose equivalents. Named volumes also get a top-level volumes entry with name: set, so Compose reuses the existing Docker volume instead of creating a prefixed one. Flags with no Compose equivalent are not silently dropped — they are listed as warnings above the output.

    • Flags like -d, --rm and --pull have no Compose equivalent; they appear in the warnings list only.
    • --network host and --network none become network_mode: host or network_mode: none on the service.
    • Several docker run commands pasted at once become several services in a single file.

    Common questions

    Which docker run flags are supported?

    The converter handles ports, environment variables, volumes, mounts, networks, restart policies, resource limits, logging, healthchecks, labels, capabilities, user, hostname, extra hosts, stdin/tty and privileged mode. Flags with no Compose equivalent (like -d or --rm) are listed as warnings instead of being silently dropped.

    How are named volumes handled?

    Named volumes get a top-level volumes entry with name: set, so Compose reuses the existing Docker volume instead of creating a prefixed one.

    What happens with --network host?

    host and none have no Compose network equivalent, so they become network_mode: host or network_mode: none on the service.

    Is my command uploaded anywhere?

    No. Conversion runs entirely in your browser; nothing leaves your device.