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.

25 lines
1.1 KiB

  1. #!/bin/bash
  2. echo "####################################################################"
  3. echo "# docker_php_apache_build_script #"
  4. echo "# Dennis Buchhorn - bucde@b-eit.de #"
  5. echo "####################################################################"
  6. echo "# This script will build an 'php:7.4-apache-buster' image with #"
  7. echo "# customized uid and gid for 'www-data' user. #"
  8. echo "# With this you can bind mount volumes to /var/www/html/* and have #"
  9. echo "# the same permissions from the host (if uid and gid matches). #"
  10. #echo "# #"
  11. echo "####################################################################"
  12. echo ""
  13. PHP_APACHE_IMAGE_NAME="b-eit/php:7.4-apache-buster"
  14. PHP_APACHE_WWW_DATA_UID=""
  15. PHP_APACHE_WWW_DATA_GID=""
  16. read -p "Enter uid for 'www-data' user: " PHP_APACHE_WWW_DATA_UID
  17. read -p "Enter gid for 'www-data' user: " PHP_APACHE_WWW_DATA_GID
  18. docker build -t $PHP_APACHE_IMAGE_NAME --build-arg PHP_APACHE_WWW_DATA_UID=$PHP_APACHE_WWW_DATA_UID --build-arg PHP_APACHE_WWW_DATA_GID=$PHP_APACHE_WWW_DATA_GID .
  19. echo "Done!"