How to run commands as root / sudo user in a docker container ?
Example : connect as root user (where php is the container name)
docker-compose exec --user=root php bash
Edit bashrc file (~/.bashrc
)
Method 1 : Install and run drush as described in this article
This is the recommended method