You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
464 B

5 years ago
  1. #!/bin/bash
  2. SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))"
  3. . $SCRIPT_DIR/_docker-cmd.sh || {
  4. echo "no docker cmd is presented" && exit 1
  5. }
  6. PHP_VERSION=$1 # Without dot
  7. if [[ -z "${PHP_VERSION}" ]]; then PHP_VERSION=81; fi
  8. CONTAINER=$(docker ps | grep workspace${PHP_VERSION} | awk '{print $1}')
  9. if [[ -z "${CONTAINER}" ]]; then
  10. echo "Unable to find container: workspace${PHP_VERSION}"
  11. exit 1
  12. fi
  13. $DOCKER_CMD exec -ti ${CONTAINER} su laradock