Docker / Podman Composer by

Supports docker run and podman run. Line continuations (\) and combined flags (-it) are handled automatically.

Docker / Podman Run Command

Docker Compose YAML editable

Paste a docker-compose.yml and generate the equivalent run command for each service.

Docker Compose YAML

Generated Run Commands

Flag Reference: docker run → Compose

docker run flag Compose key Notes
Container Identity
--name NAMEcontainer_name: NAMEAlso used as service name
--hostname HOSThostname: HOST
--platform linux/amd64platform: linux/amd64
Image & Command
IMAGE[:TAG]image: IMAGE[:TAG]Positional argument
COMMAND [ARGS]command: COMMANDAfter image name
--entrypoint CMDentrypoint: CMD
Ports & Volumes
-p 80:80ports: ["80:80"]Short & long syntax
--expose 8080expose: [8080]Internal port only
-v /host:/cntvolumes: [/host:/cnt]Bind mount
-v name:/cntvolumes: [name:/cnt]Named volume
--tmpfs /tmptmpfs: [/tmp]
Environment
-e KEY=VALUEenvironment: [KEY=VALUE]Or object syntax
--env-file .envenv_file: [.env]
Network
--network NAMEnetworks: [NAME]
--dns 8.8.8.8dns: [8.8.8.8]
--dns-search domdns_search: [dom]
--add-host h:ipextra_hosts: [h:ip]
Lifecycle
--restart POLICYrestart: POLICYno, always, unless-stopped, on-failure
-d / --detachImplicit in Compose
--rmNo equivalent; omit restart
--stop-signal SIGstop_signal: SIG
--stop-timeout Nstop_grace_period: Ns
Runtime Flags
-t / --ttytty: true
-i / --interactivestdin_open: true
--privilegedprivileged: true
--read-onlyread_only: true
--initinit: true
-u USERuser: USER
-w /pathworking_dir: /path
Security
--cap-add CAPcap_add: [CAP]
--cap-drop CAPcap_drop: [CAP]
--security-opt OPTsecurity_opt: [OPT]
--device /dev/xdevices: [/dev/x]
Resources
-m 512mmem_limit: 512m
--memory-swap 1gmemswap_limit: 1g
--cpu-shares 512cpu_shares: 512
--cpus 1.5cpus: 1.5
--cpuset-cpus 0-1cpuset: 0-1
--shm-size 64mshm_size: 64m
--ulimit nf=1024ulimits.nofile: 1024
Logging
--log-driver DRVlogging.driver: DRV
--log-opt K=Vlogging.options.K: V
Healthcheck
--health-cmd CMDhealthcheck.test: [CMD-SHELL, CMD]
--health-interval Thealthcheck.interval: T
--health-timeout Thealthcheck.timeout: T
--health-retries Nhealthcheck.retries: N
--no-healthcheckhealthcheck.disable: true
Labels
-l KEY=VALlabels: [KEY=VAL]

Compose-only Features

These Compose features have no direct docker run equivalent:

depends_on
Start order & health conditions between services
build
Build image from Dockerfile inline
profiles
Conditional service activation
deploy
Swarm/resource constraints (replicas, resources)
secrets / configs
Swarm secrets and configs
Top-level volumes
Named volume declarations with driver options

Restart Policies

ValueBehavior
noNever restart (default)
alwaysAlways restart
unless-stoppedRestart unless manually stopped
on-failureOnly on non-zero exit
on-failure:3Max 3 retries

Tips

  • Use \ at line end to break long commands across multiple lines.
  • Combined flags like -it or -dp are parsed correctly.
  • Both --flag value and --flag=value formats are supported.
  • The YAML output is editable — add depends_on, build or custom network configs after conversion.
  • Multiple services in a Compose file each generate their own docker run command.