File tree Expand file tree Collapse file tree 13 files changed +29
-39
lines changed
Compose/ProductionBuilder/Service Expand file tree Collapse file tree 13 files changed +29
-39
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 5858# Configure PHP-FPM
5959[ ! -z " ${MAGENTO_RUN_MODE} " ] && sed -i " s/!MAGENTO_RUN_MODE!/${MAGENTO_RUN_MODE} /" /usr/local/etc/php-fpm.conf
6060
61- # Set host.docker.inernal for LINUX os
62- if [[ " $SET_DOCKER_HOST " = " true" ]]; then
63- apt update
64- apt install -y iproute2
65- echo -e " ` /sbin/ip route| awk ' /default/ { print $3 }' ` \thost.docker.internal" | sudo tee -a /etc/hosts > /dev/null
61+ # Set host.docker.inernal if not available
62+ HOST_NAME=" host.docker.internal"
63+ HOST_IP=$( php -r " putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME ');" )
64+ if [[ " $HOST_IP " == " $HOST_NAME " ]]; then
65+ HOST_IP=$( /sbin/ip route| awk ' /default/ { print $3 }' )
66+ printf " \n%s %s\n" " $HOST_IP " " $HOST_NAME " >> /etc/hosts
6667fi
6768
6869exec " $@ "
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 5858# Configure PHP-FPM
5959[ ! -z " ${MAGENTO_RUN_MODE} " ] && sed -i " s/!MAGENTO_RUN_MODE!/${MAGENTO_RUN_MODE} /" /usr/local/etc/php-fpm.conf
6060
61- # Set host.docker.inernal for LINUX os
62- if [[ " $SET_DOCKER_HOST " = " true" ]]; then
63- apt update
64- apt install -y iproute2
65- echo -e " ` /sbin/ip route| awk ' /default/ { print $3 }' ` \thost.docker.internal" | sudo tee -a /etc/hosts > /dev/null
61+ # Set host.docker.inernal if not available
62+ HOST_NAME=" host.docker.internal"
63+ HOST_IP=$( php -r " putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME ');" )
64+ if [[ " $HOST_IP " == " $HOST_NAME " ]]; then
65+ HOST_IP=$( /sbin/ip route| awk ' /default/ { print $3 }' )
66+ printf " \n%s %s\n" " $HOST_IP " " $HOST_NAME " >> /etc/hosts
6667fi
6768
6869exec " $@ "
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 5858# Configure PHP-FPM
5959[ ! -z " ${MAGENTO_RUN_MODE} " ] && sed -i " s/!MAGENTO_RUN_MODE!/${MAGENTO_RUN_MODE} /" /usr/local/etc/php-fpm.conf
6060
61- # Set host.docker.inernal for LINUX os
62- if [[ " $SET_DOCKER_HOST " = " true" ]]; then
63- apt update
64- apt install -y iproute2
65- echo -e " ` /sbin/ip route| awk ' /default/ { print $3 }' ` \thost.docker.internal" | sudo tee -a /etc/hosts > /dev/null
61+ # Set host.docker.inernal if not available
62+ HOST_NAME=" host.docker.internal"
63+ HOST_IP=$( php -r " putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME ');" )
64+ if [[ " $HOST_IP " == " $HOST_NAME " ]]; then
65+ HOST_IP=$( /sbin/ip route| awk ' /default/ { print $3 }' )
66+ printf " \n%s %s\n" " $HOST_IP " " $HOST_NAME " >> /etc/hosts
6667fi
6768
6869exec " $@ "
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 5858# Configure PHP-FPM
5959[ ! -z " ${MAGENTO_RUN_MODE} " ] && sed -i " s/!MAGENTO_RUN_MODE!/${MAGENTO_RUN_MODE} /" /usr/local/etc/php-fpm.conf
6060
61- # Set host.docker.inernal for LINUX os
62- if [[ " $SET_DOCKER_HOST " = " true" ]]; then
63- apt update
64- apt install -y iproute2
65- echo -e " ` /sbin/ip route| awk ' /default/ { print $3 }' ` \thost.docker.internal" | sudo tee -a /etc/hosts > /dev/null
61+ # Set host.docker.inernal if not available
62+ HOST_NAME=" host.docker.internal"
63+ HOST_IP=$( php -r " putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); echo gethostbyname('$HOST_NAME ');" )
64+ if [[ " $HOST_IP " == " $HOST_NAME " ]]; then
65+ HOST_IP=$( /sbin/ip route| awk ' /default/ { print $3 }' )
66+ printf " \n%s %s\n" " $HOST_IP " " $HOST_NAME " >> /etc/hosts
6667fi
6768
6869exec " $@ "
Original file line number Diff line number Diff line change @@ -181,11 +181,6 @@ protected function configure(): void
181181 null ,
182182 InputOption::VALUE_REQUIRED ,
183183 'MailHog HTTP port '
184- )->addOption (
185- Source \CliSource::OPTION_SET_DOCKER_HOST_XDEBUG ,
186- null ,
187- InputOption::VALUE_NONE ,
188- 'Sets host.docker.internal for fpm_xdebug container to resolve debug issue for LINUX system '
189184 );
190185
191186 $ this ->addOption (
Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ class GeneratePhp extends Command
3535 'apt-utils ' ,
3636 'sendmail-bin ' ,
3737 'sendmail ' ,
38- 'sudo '
38+ 'sudo ' ,
39+ 'iproute2 '
3940 ];
4041 private const DEFAULT_PACKAGES_PHP_CLI = [
4142 'apt-utils ' ,
You can’t perform that action at this time.
0 commit comments