#!/bin/bash echo "####################################################################" echo "# docker_php_apache_build_script #" echo "# Dennis Buchhorn - bucde@b-eit.de #" echo "####################################################################" echo "# This script will build an 'php:7.4-apache-buster' image with #" echo "# customized uid and gid for 'www-data' user. #" echo "# With this you can bind mount volumes to /var/www/html/* and have #" echo "# the same permissions from the host (if uid and gid matches). #" #echo "# #" echo "####################################################################" echo "" PHP_APACHE_IMAGE_NAME="b-eit/php:7.4-apache-buster" PHP_APACHE_WWW_DATA_UID="" PHP_APACHE_WWW_DATA_GID="" read -p "Enter uid for 'www-data' user: " PHP_APACHE_WWW_DATA_UID read -p "Enter gid for 'www-data' user: " PHP_APACHE_WWW_DATA_GID 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 . echo "Done!"