docker-compose run <service> <command>
Run a one-off command on a service
Arguments
Name | Description |
---|
service | |
command | |
Options
Name | Description |
---|
--detach, -d | Run container in background and print container ID |
--entrypoint <entrypoint> | Override the entrypoint of the image |
--env, -e <env> | |
--interactive, -i | Keep STDIN open even if not attached |
--label, -l <label> | |
--name <name> | Assign a name to the container |
--no-TTY, -T | Disable pseudo-TTY allocation (default: auto-detected) |
--no-deps | Don't start linked services |
--publish, -p <publish> | |
--quiet-pull | Pull without printing progress information |
--rm | Automatically remove the container when it exits |
--service-ports | Run command with the service's ports enabled and mapped to the host |
--tty, -t | Allocate a pseudo-TTY |
--use-aliases | Use the service's network useAliases in the network(s) the container connects to |
--user, -u <user> | Run as specified username or uid |
--volume, -v <volume> | |
--workdir, -w <workdir> | Working directory inside the container |