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
9
9
ENV UPLOAD_MAX_FILESIZE 64M
10
10
ENV UPDATE_UID_GID false
11
11
ENV ENABLE_SENDMAIL true
12
- ENV SET_DOCKER_HOST false
13
12
14
13
ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sysvmsg sysvsem sysvshm xsl zip pcntl
15
14
@@ -21,6 +20,7 @@ RUN apt-get update \
21
20
sendmail-bin \
22
21
sendmail \
23
22
sudo \
23
+ iproute2 \
24
24
libbz2-dev \
25
25
libjpeg62-turbo-dev \
26
26
libpng-dev \
Original file line number Diff line number Diff line change 61
61
# Configure PHP-FPM
62
62
[ ! -z " ${MAGENTO_RUN_MODE} " ] && sed -i " s/!MAGENTO_RUN_MODE!/${MAGENTO_RUN_MODE} /" /usr/local/etc/php-fpm.conf
63
63
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
69
70
fi
70
71
71
72
exec " $@ "
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ ENV MAGENTO_RUN_MODE production
9
9
ENV UPLOAD_MAX_FILESIZE 64M
10
10
ENV UPDATE_UID_GID false
11
11
ENV ENABLE_SENDMAIL true
12
- ENV SET_DOCKER_HOST false
13
12
14
13
ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sysvmsg sysvsem sysvshm xsl zip pcntl
15
14
@@ -21,6 +20,7 @@ RUN apt-get update \
21
20
sendmail-bin \
22
21
sendmail \
23
22
sudo \
23
+ iproute2 \
24
24
libbz2-dev \
25
25
libjpeg62-turbo-dev \
26
26
libpng-dev \
Original file line number Diff line number Diff line change 61
61
# Configure PHP-FPM
62
62
[ ! -z " ${MAGENTO_RUN_MODE} " ] && sed -i " s/!MAGENTO_RUN_MODE!/${MAGENTO_RUN_MODE} /" /usr/local/etc/php-fpm.conf
63
63
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
69
70
fi
70
71
71
72
exec " $@ "
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ ENV MAGENTO_RUN_MODE production
9
9
ENV UPLOAD_MAX_FILESIZE 64M
10
10
ENV UPDATE_UID_GID false
11
11
ENV ENABLE_SENDMAIL true
12
- ENV SET_DOCKER_HOST false
13
12
14
13
ENV PHP_EXTENSIONS bcmath bz2 calendar exif gd gettext intl mysqli opcache pdo_mysql redis soap sockets sysvmsg sysvsem sysvshm xsl zip pcntl
15
14
@@ -21,6 +20,7 @@ RUN apt-get update \
21
20
sendmail-bin \
22
21
sendmail \
23
22
sudo \
23
+ iproute2 \
24
24
libbz2-dev \
25
25
libjpeg62-turbo-dev \
26
26
libpng-dev \
Original file line number Diff line number Diff line change 61
61
# Configure PHP-FPM
62
62
[ ! -z " ${MAGENTO_RUN_MODE} " ] && sed -i " s/!MAGENTO_RUN_MODE!/${MAGENTO_RUN_MODE} /" /usr/local/etc/php-fpm.conf
63
63
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
69
70
fi
70
71
71
72
exec " $@ "
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ ENV MAGENTO_RUN_MODE production
9
9
ENV UPLOAD_MAX_FILESIZE 64M
10
10
ENV UPDATE_UID_GID false
11
11
ENV ENABLE_SENDMAIL true
12
- ENV SET_DOCKER_HOST false
13
12
14
13
{%env_php_extensions%}
15
14
Original file line number Diff line number Diff line change 61
61
# Configure PHP-FPM
62
62
[ ! -z " ${MAGENTO_RUN_MODE} " ] && sed -i " s/!MAGENTO_RUN_MODE!/${MAGENTO_RUN_MODE} /" /usr/local/etc/php-fpm.conf
63
63
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
69
70
fi
70
71
71
72
exec " $@ "
Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ protected function configure(): void
187
187
Source \CliSource::OPTION_SET_DOCKER_HOST_XDEBUG ,
188
188
null ,
189
189
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 '
191
191
)->addOption (
192
192
Source \CliSource::OPTION_NGINX_WORKER_PROCESSES ,
193
193
null ,
Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ class GeneratePhp extends Command
36
36
'apt-utils ' ,
37
37
'sendmail-bin ' ,
38
38
'sendmail ' ,
39
- 'sudo '
39
+ 'sudo ' ,
40
+ 'iproute2 '
40
41
];
41
42
private const DEFAULT_PACKAGES_PHP_CLI = [
42
43
'apt-utils ' ,
You can’t perform that action at this time.
0 commit comments