Execute commands in Docker containers
Last updated
Was this helpful?
Last updated
Was this helpful?
yarn run exec <container name> [commands]
or npm run exec -- <container name> [commands]
Executes command in a chosen container.
This command is basically a wrapper on top of command. It simplifies execution command in docker containers by providing names for docker containers so you don't have to search them by running a command or docker ps
.
If you don't want to execute specific command, by default exec command will use bash as a command (and redis-cli for redis container) so you will be connected to the container with interactive shell environment.
mariadb
php
varnish
nginx
ssl-terminator
redis
elasticsearch
or opensearch
(depending on your configuration)