CmdID / docker / docker compose
docker compose run
Runs a one-time command against a service. Docker Compose reference
26 options Its page in the Docker Compose reference
Options
Show its 26 options
--buildBuild image before starting container--cap-addAdd Linux capabilities--cap-dropDrop Linux capabilities--detach, -dRun container in background and print container ID--dry-runExecute command in dry run mode--entrypointOverride the entrypoint of the image--env, -eSet environment variables--env-from-fileSet environment variables from file--interactive, -iKeep STDIN open even if not attached--label, -lAdd or override a label--nameAssign a name to the container--no-depsDon't start linked services--no-recreateIf dependent containers already exist, don't recreate them, even if their configuration diverged--no-tty, -TDisable pseudo-TTY allocation (default: auto-detected)--publish, -pPublish a container's port(s) to the host--pullPull image before running ("always"\--quiet, -qDon't print anything to STDOUT--quiet-buildSuppress progress output from the build process--quiet-pullPull without printing progress information--remove-orphansRemove containers for services not defined in the Compose file--rmAutomatically remove the container when it exits--service-ports, -PRun command with all service's ports enabled and mapped to the host--use-aliasesUse the service's network useAliases in the network(s) the container connects to--user, -uRun as specified username or uid--volume, -vBind mount a volume--workdir, -wWorking directory inside the container