From 643669445c90936b0b69e84482b8f826c0d8e852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B3=D0=BE=D1=80=D1=8C=20=D0=94=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB=D0=BE=D0=B2?= <59930161+polarikus@users.noreply.github.com> Date: Tue, 4 Oct 2022 19:29:34 +0300 Subject: [PATCH 1/5] Update .env.example --- .env.example | 1 + 1 file changed, 1 insertion(+) diff --git a/.env.example b/.env.example index fcf0785..d3bfd70 100644 --- a/.env.example +++ b/.env.example @@ -378,6 +378,7 @@ APACHE_PHP_UPSTREAM_TIMEOUT=60 APACHE_DOCUMENT_ROOT=/var/www/ APACHE_SSL_PATH=./apache2/ssl/ APACHE_INSTALL_HTTP2=false +APACHE_FOR_MAC_M1=false ### MYSQL ################################################# From 05536fb6a10a6e84b35ff07376c67797cc3b56b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B3=D0=BE=D1=80=D1=8C=20=D0=94=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB=D0=BE=D0=B2?= <59930161+polarikus@users.noreply.github.com> Date: Tue, 4 Oct 2022 19:31:34 +0300 Subject: [PATCH 2/5] Update docker-compose.yml --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index 74fb92c..6fd901c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -485,6 +485,7 @@ services: - PHP_UPSTREAM_TIMEOUT=${APACHE_PHP_UPSTREAM_TIMEOUT} - DOCUMENT_ROOT=${APACHE_DOCUMENT_ROOT} - APACHE_INSTALL_HTTP2=${APACHE_INSTALL_HTTP2} + - M1=${APACHE_FOR_MAC_M1} volumes: - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG} - ${APACHE_HOST_LOG_PATH}:/var/log/apache2 From db1b30ecf229097b03b942fd630c9541f970d7f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B3=D0=BE=D1=80=D1=8C=20=D0=94=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB=D0=BE=D0=B2?= <59930161+polarikus@users.noreply.github.com> Date: Tue, 4 Oct 2022 19:49:08 +0300 Subject: [PATCH 3/5] Update Dockerfile script for M1 --- apache2/Dockerfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apache2/Dockerfile b/apache2/Dockerfile index 9fd4315..a24cc9c 100644 --- a/apache2/Dockerfile +++ b/apache2/Dockerfile @@ -29,4 +29,13 @@ ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"] CMD ["/bin/bash", "/opt/startup.sh"] -EXPOSE 80 443 \ No newline at end of file +EXPOSE 80 443 + +ARG APACHE_FOR_MAC_M1=false + +RUN if [ ${APACHE_FOR_MAC_M1} = true ]; then \ + # Change application source from deb.debian.org to aliyun source + wget -O "/usr/local/bin/go-replace" "https://github.com/webdevops/goreplace/releases/download/1.1.2/gr-arm64-linux" && \ + chmod +x "/usr/local/bin/go-replace" && \ + "/usr/local/bin/go-replace" --version \ +;fi From 98c5d7ba641cd68bf5dace35a0f74c0a1f40e4c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B3=D0=BE=D1=80=D1=8C=20=D0=94=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB=D0=BE=D0=B2?= <59930161+polarikus@users.noreply.github.com> Date: Tue, 4 Oct 2022 19:52:29 +0300 Subject: [PATCH 4/5] Update docker-compose.yml --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6fd901c..82a153c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -485,7 +485,7 @@ services: - PHP_UPSTREAM_TIMEOUT=${APACHE_PHP_UPSTREAM_TIMEOUT} - DOCUMENT_ROOT=${APACHE_DOCUMENT_ROOT} - APACHE_INSTALL_HTTP2=${APACHE_INSTALL_HTTP2} - - M1=${APACHE_FOR_MAC_M1} + - APACHE_FOR_MAC_M1=${APACHE_FOR_MAC_M1} volumes: - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG} - ${APACHE_HOST_LOG_PATH}:/var/log/apache2 From ed48e4ee1babf5eb0b5fe7909d706da22af7e74d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=B3=D0=BE=D1=80=D1=8C=20=D0=94=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB=D0=BE=D0=B2?= <59930161+polarikus@users.noreply.github.com> Date: Tue, 4 Oct 2022 20:05:01 +0300 Subject: [PATCH 5/5] Update index.md Add ## Apache2 container won't start on mac m1 --- DOCUMENTATION/content/help/index.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/DOCUMENTATION/content/help/index.md b/DOCUMENTATION/content/help/index.md index c10bb00..8f3e655 100644 --- a/DOCUMENTATION/content/help/index.md +++ b/DOCUMENTATION/content/help/index.md @@ -127,3 +127,21 @@ WORKSPACE_INSTALL_LIBPNG=true docker-compose build workspace ``` +## Apache2 container won't start on mac m1 + +To fix the problem you can follow those steps + +1 - Open the `.env`. + +2 - Search for `APACHE_FOR_MAC_M1` or add the key, if missing. + +3 - Set the value to true: + +```dotenv +APACHE_FOR_MAC_M1=true +``` +4 - Finally rebuild the workspace image + +```bash +docker-compose build apache2 +```