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
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 58
58
# Configure PHP-FPM
59
59
[ ! -z " ${MAGENTO_RUN_MODE} " ] && sed -i " s/!MAGENTO_RUN_MODE!/${MAGENTO_RUN_MODE} /" /usr/local/etc/php-fpm.conf
60
60
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
66
67
fi
67
68
68
69
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 58
58
# Configure PHP-FPM
59
59
[ ! -z " ${MAGENTO_RUN_MODE} " ] && sed -i " s/!MAGENTO_RUN_MODE!/${MAGENTO_RUN_MODE} /" /usr/local/etc/php-fpm.conf
60
60
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
66
67
fi
67
68
68
69
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 58
58
# Configure PHP-FPM
59
59
[ ! -z " ${MAGENTO_RUN_MODE} " ] && sed -i " s/!MAGENTO_RUN_MODE!/${MAGENTO_RUN_MODE} /" /usr/local/etc/php-fpm.conf
60
60
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
66
67
fi
67
68
68
69
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 58
58
# Configure PHP-FPM
59
59
[ ! -z " ${MAGENTO_RUN_MODE} " ] && sed -i " s/!MAGENTO_RUN_MODE!/${MAGENTO_RUN_MODE} /" /usr/local/etc/php-fpm.conf
60
60
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
66
67
fi
67
68
68
69
exec " $@ "
Original file line number Diff line number Diff line change @@ -181,11 +181,6 @@ protected function configure(): void
181
181
null ,
182
182
InputOption::VALUE_REQUIRED ,
183
183
'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 '
189
184
);
190
185
191
186
$ this ->addOption (
Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ class GeneratePhp extends Command
35
35
'apt-utils ' ,
36
36
'sendmail-bin ' ,
37
37
'sendmail ' ,
38
- 'sudo '
38
+ 'sudo ' ,
39
+ 'iproute2 '
39
40
];
40
41
private const DEFAULT_PACKAGES_PHP_CLI = [
41
42
'apt-utils ' ,
You can’t perform that action at this time.
0 commit comments