Docker / Podman Composer by

Optional. Compose names networks, volumes and containers after it (myapp_default, myapp-web-1) — by default the folder name.

Paste one or more docker run / podman run commands — also docker network create and docker volume create. Converts as you type; quoting, \ line breaks, -dp 80:80 and --mount are understood. Variables like $HOME stay variables (Compose fills them in), quoted '$5' becomes $$5.

Docker / Podman Run Command

Docker Compose YAML editable

Paste a compose.yaml — you get a shell script: networks first, then one run per service in depends_on order. ${VAR} stays a shell variable, $$ becomes a literal $; everything else is single-quoted.

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. Back in run: without container_name the name is project-service-1, like Compose
--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]run takes one program; entrypoint: [sh, -c] becomes --entrypoint sh + -c before the command
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 — declared as external: true, so Compose uses the existing one instead of a new project_name
--mount type=bind,src=…,dst=…volumes: [{type: bind, …}]Long syntax; --mount does not create missing host folders
--tmpfs /tmptmpfs: [/tmp]
Environment
-e KEY=VALUEenvironment: [KEY=VALUE]Or object syntax
--env-file .envenv_file: [.env]
Network
--network NAMEnetworks: [NAME]Declared as external: true unless the input has docker network create NAME. Without --network, run uses the default bridge, Compose its own project_default network
--network hostnetwork_mode: hostAlso none, bridge, container:NAME (Compose: service:NAME)
--network-alias A, --ipnetworks: {NAME: {aliases: [A]}}Compose adds the service name as alias on every network
--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 / --detach—Implicit in Compose
--rm—No equivalent — docker compose run --rm for one-off runs
--pull alwayspull_policy: always
--stop-signal SIGstop_signal: SIG
--stop-timeout Nstop_grace_period: NsBack in run: durations like 1m30s become seconds (90)
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 nofile=1024:2048ulimits: {nofile: {soft: 1024, hard: 2048}}
--gpus alldeploy.resources.reservations.devicesPodman: --device nvidia.com/gpu=all (CDI)
--memory / --cpusdeploy.resources.limitsBoth forms are read; mem_limit/cpus are written
Logging
--log-driver DRVlogging.driver: DRV
--log-opt K=Vlogging.options.K: V
Healthcheck
--health-cmd CMDhealthcheck.test: [CMD-SHELL, CMD]run only knows the shell form; [CMD, …] is quoted word by word
--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 — the script keeps it, but conditions like service_healthy are not waited for
build
Becomes docker build -t project-service … before the run
profiles, replicas, scale
Ignored with a note — the command always starts one container
secrets / configs
File-based ones become read-only mounts under /run/secrets/; environment/content ones get a note
Interpolation
${VAR:-default} stays a shell variable; Compose would also read .env — export those variables first

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, -dp 80:80 or -p8080:80 and both --flag value and --flag=value are understood.
  • Several run commands become several services in one file; anything that cannot be converted is listed under the output.
  • Check the result with docker compose config — it reports undefined networks and volumes.
  • Quote port mappings ("8080:80"): older YAML readers take 22:22 as a number in base 60.