File tree Expand file tree Collapse file tree 13 files changed +35
-35
lines changed
Compose/ProductionBuilder/Service Expand file tree Collapse file tree 13 files changed +35
-35
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ ENV MAGENTO_RUN_MODE production
99ENV UPLOAD_MAX_FILESIZE 64M
1010ENV UPDATE_UID_GID false
1111ENV ENABLE_SENDMAIL true
12- ENV SET_DOCKER_HOST false
1312
1413ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sysvmsg sysvsem sysvshm xsl zip pcntl
1514
@@ -21,6 +20,7 @@ RUN apt-get update \
2120 sendmail-bin \
2221 sendmail \
2322 sudo \
23+ iproute2 \
2424 libbz2-dev \
2525 libjpeg62-turbo-dev \
2626 libpng-dev \
Original file line number Diff line number Diff line change 6161# Configure PHP-FPM
6262[ ! -z " ${MAGENTO_RUN_MODE} " ] && sed -i " s/!MAGENTO_RUN_MODE!/${MAGENTO_RUN_MODE} /" /usr/local/etc/php-fpm.conf
6363
64- # Set host.docker.inernal for LINUX os
65- if [[ " $SET_DOCKER_HOST " = " true" ]]; then
66- apt update
67- apt install -y iproute2
68- echo -e " ` /sbin/ip route| awk ' /default/ { print $3 }' ` \thost.docker.internal" | sudo tee -a /etc/hosts > /dev/null
64+ # Set host.docker.inernal if not available
65+ HOST_NAME=" host.docker.internal"
66+ HOST_IP=$( php -r " putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME ');" )
67+ if [[ " $HOST_IP " == " $HOST_NAME " ]]; then
68+ HOST_IP=$( /sbin/ip route| awk ' /default/ { print $3 }' )
69+ printf " \n%s %s\n" " $HOST_IP " " $HOST_NAME " >> /etc/hosts
6970fi
7071
7172exec " $@ "
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ ENV MAGENTO_RUN_MODE production
99ENV UPLOAD_MAX_FILESIZE 64M
1010ENV UPDATE_UID_GID false
1111ENV ENABLE_SENDMAIL true
12- ENV SET_DOCKER_HOST false
1312
1413ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sysvmsg sysvsem sysvshm xsl zip pcntl
1514
@@ -21,6 +20,7 @@ RUN apt-get update \
2120 sendmail-bin \
2221 sendmail \
2322 sudo \
23+ iproute2 \
2424 libbz2-dev \
2525 libjpeg62-turbo-dev \
2626 libpng-dev \
Original file line number Diff line number Diff line change 6161# Configure PHP-FPM
6262[ ! -z " ${MAGENTO_RUN_MODE} " ] && sed -i " s/!MAGENTO_RUN_MODE!/${MAGENTO_RUN_MODE} /" /usr/local/etc/php-fpm.conf
6363
64- # Set host.docker.inernal for LINUX os
65- if [[ " $SET_DOCKER_HOST " = " true" ]]; then
66- apt update
67- apt install -y iproute2
68- echo -e " ` /sbin/ip route| awk ' /default/ { print $3 }' ` \thost.docker.internal" | sudo tee -a /etc/hosts > /dev/null
64+ # Set host.docker.inernal if not available
65+ HOST_NAME=" host.docker.internal"
66+ HOST_IP=$( php -r " putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME ');" )
67+ if [[ " $HOST_IP " == " $HOST_NAME " ]]; then
68+ HOST_IP=$( /sbin/ip route| awk ' /default/ { print $3 }' )
69+ printf " \n%s %s\n" " $HOST_IP " " $HOST_NAME " >> /etc/hosts
6970fi
7071
7172exec " $@ "
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ ENV MAGENTO_RUN_MODE production
99ENV UPLOAD_MAX_FILESIZE 64M
1010ENV UPDATE_UID_GID false
1111ENV ENABLE_SENDMAIL true
12- ENV SET_DOCKER_HOST false
1312
1413ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sysvmsg sysvsem sysvshm xsl zip pcntl
1514
@@ -21,6 +20,7 @@ RUN apt-get update \
2120 sendmail-bin \
2221 sendmail \
2322 sudo \
23+ iproute2 \
2424 libbz2-dev \
2525 libjpeg62-turbo-dev \
2626 libpng-dev \
Original file line number Diff line number Diff line change 6161# Configure PHP-FPM
6262[ ! -z " ${MAGENTO_RUN_MODE} " ] && sed -i " s/!MAGENTO_RUN_MODE!/${MAGENTO_RUN_MODE} /" /usr/local/etc/php-fpm.conf
6363
64- # Set host.docker.inernal for LINUX os
65- if [[ " $SET_DOCKER_HOST " = " true" ]]; then
66- apt update
67- apt install -y iproute2
68- echo -e " ` /sbin/ip route| awk ' /default/ { print $3 }' ` \thost.docker.internal" | sudo tee -a /etc/hosts > /dev/null
64+ # Set host.docker.inernal if not available
65+ HOST_NAME=" host.docker.internal"
66+ HOST_IP=$( php -r " putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME ');" )
67+ if [[ " $HOST_IP " == " $HOST_NAME " ]]; then
68+ HOST_IP=$( /sbin/ip route| awk ' /default/ { print $3 }' )
69+ printf " \n%s %s\n" " $HOST_IP " " $HOST_NAME " >> /etc/hosts
6970fi
7071
7172exec " $@ "
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ ENV MAGENTO_RUN_MODE production
99ENV UPLOAD_MAX_FILESIZE 64M
1010ENV UPDATE_UID_GID false
1111ENV ENABLE_SENDMAIL true
12- ENV SET_DOCKER_HOST false
1312
1413{%env_php_extensions%}
1514
Original file line number Diff line number Diff line change 6161# Configure PHP-FPM
6262[ ! -z " ${MAGENTO_RUN_MODE} " ] && sed -i " s/!MAGENTO_RUN_MODE!/${MAGENTO_RUN_MODE} /" /usr/local/etc/php-fpm.conf
6363
64- # Set host.docker.inernal for LINUX os
65- if [[ " $SET_DOCKER_HOST " = " true" ]]; then
66- apt update
67- apt install -y iproute2
68- echo -e " ` /sbin/ip route| awk ' /default/ { print $3 }' ` \thost.docker.internal" | sudo tee -a /etc/hosts > /dev/null
64+ # Set host.docker.inernal if not available
65+ HOST_NAME=" host.docker.internal"
66+ HOST_IP=$( php -r " putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME ');" )
67+ if [[ " $HOST_IP " == " $HOST_NAME " ]]; then
68+ HOST_IP=$( /sbin/ip route| awk ' /default/ { print $3 }' )
69+ printf " \n%s %s\n" " $HOST_IP " " $HOST_NAME " >> /etc/hosts
6970fi
7071
7172exec " $@ "
Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ protected function configure(): void
187187 Source \CliSource::OPTION_SET_DOCKER_HOST_XDEBUG ,
188188 null ,
189189 InputOption::VALUE_NONE ,
190- 'Sets host.docker.internal for fpm_xdebug container to resolve debug issue for LINUX system '
190+ 'Deprecated option to resolve host.docker.internal on Linux. Did nothing at the moment '
191191 )->addOption (
192192 Source \CliSource::OPTION_NGINX_WORKER_PROCESSES ,
193193 null ,
Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ class GeneratePhp extends Command
3636 'apt-utils ' ,
3737 'sendmail-bin ' ,
3838 'sendmail ' ,
39- 'sudo '
39+ 'sudo ' ,
40+ 'iproute2 '
4041 ];
4142 private const DEFAULT_PACKAGES_PHP_CLI = [
4243 'apt-utils ' ,
You can’t perform that action at this time.
0 commit comments