Docker Compose: Run one-off command in Docker service
2 December 2022 (Updated 26 January 2023)
Syntax:
docker compose exec <service-name> <cmd>
Example:
docker compose exec php ls -la
As a specific user
docker compose exec --user=<user-name> <service-name>
Tagged:
Docker Compose
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment