2
0
Эх сурвалжийг харах

Added bin/root script helper to enter cli as root

Mark Shust 7 жил өмнө
parent
commit
7f0f64166e

+ 1 - 0
README.md

@@ -116,6 +116,7 @@ See the `compose` folder for sample setups for both Magento 1 and Magento 2. Bas
 - `./bin/fixperms`: This will fix filesystem ownerships and permissions within Docker.
 - `./bin/initloopback`: Setup your ip loopback for proper Docker ip resolution.
 - `./bin/magento`: Run the Magento CLI. Ex: `./bin/magento cache:flush`
+- `./bin/root`: Run any CLI command as root without going into the bash prompt. Ex `./bin/root apt-get install nano`
 - `./bin/setup`: Run the Magento setup process to install Magento from the source code.
 - `./bin/start`: Start the Docker Compose process and your app. Ctrl+C to stop the process.
 - `./bin/xdebug`: Disable or enable Xdebug. Ex. `./bin/xdebug enable`

+ 3 - 0
compose/magento-1/bin/root

@@ -0,0 +1,3 @@
+#!/bin/bash
+[ -z "$1" ] && echo "Please specify a CLI command (ex. ls)" && exit
+docker-compose exec -u root phpfpm "$@"

+ 6 - 0
compose/magento-2-windows/bin/root.ps1

@@ -0,0 +1,6 @@
+if ($args.length -eq 0) {
+    Write-Host "Please specify a CLI command (ex. ls)"
+    exit
+} else {
+    docker-compose exec -u root phpfpm $args
+}

+ 3 - 0
compose/magento-2/bin/root

@@ -0,0 +1,3 @@
+#!/bin/bash
+[ -z "$1" ] && echo "Please specify a CLI command (ex. ls)" && exit
+docker-compose exec -u root phpfpm "$@"