diff --git a/README.md b/README.md index 485884b80..13d38677f 100644 --- a/README.md +++ b/README.md @@ -282,6 +282,7 @@ It is recommended to keep your root docker config files in one repository, and y - `bin/download`: Download specific Magento version from Composer to the container, with optional arguments of the version (2.4.6-p3 [default]) and type ("community" [default], "enterprise", or "mageos"). Ex. `bin/download 2.4.6-p3 enterprise` - `bin/debug-cli`: Enable Xdebug for bin/magento, with an optional argument of the IDE key. Defaults to PHPSTORM Ex. `bin/debug-cli enable PHPSTORM` - `bin/deploy`: Runs the standard Magento deployment process commands. Pass extra locales besides `en_US` via an optional argument. Ex. `bin/deploy nl_NL` +- `bin/docker-stats`: Display status for CPU, memory usage, and memory limit of currently-running Docker containers. - `bin/fixowns`: This will fix filesystem ownerships within the container. - `bin/fixperms`: This will fix filesystem permissions within the container. - `bin/grunt`: Run the grunt binary. Ex. `bin/grunt exec` diff --git a/compose/Makefile b/compose/Makefile index c02b05f22..a564af9cb 100644 --- a/compose/Makefile +++ b/compose/Makefile @@ -31,6 +31,7 @@ help: @echo "$(call format,dev-urn-catalog-generate,'Generate URNs for PHPStorm and remap paths to local host.')" @echo "$(call format,devconsole,'Alias for n98-magerun2 dev:console.')" @echo "$(call format,devtools-cli-check,'Check & install the CLI devtools if missing from system.')" + @echo "$(call format,docker-stats,'Display status for CPU, memory usage, and memory limit of currently-running Docker containers.')" @echo "$(call format,download,'Download & extract specific Magento version to the src directory.')" @echo "$(call format,fixowns,'This will fix filesystem ownerships within the container.')" @echo "$(call format,fixperms,'This will fix filesystem permissions within the container.')" diff --git a/compose/bin/docker-stats b/compose/bin/docker-stats new file mode 100755 index 000000000..83cac7a78 --- /dev/null +++ b/compose/bin/docker-stats @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +container_ids=$(bin/docker-compose ps -q) + +if [ -z "$container_ids" ]; then + echo "No active containers found" + exit 1 +fi + +docker stats "$container_ids"