Merge pull request #3279 from polarikus/fix-apache-m1

Fix apache m1
This commit is contained in:
Shao Yu-Lung (Allen) 2022-10-23 13:46:47 +08:00 committed by GitHub
commit 2643087b71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 1 deletions

View File

@ -379,6 +379,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 #################################################

View File

@ -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
```

View File

@ -29,4 +29,13 @@ ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"]
CMD ["/bin/bash", "/opt/startup.sh"]
EXPOSE 80 443
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

View File

@ -485,6 +485,7 @@ services:
- PHP_UPSTREAM_TIMEOUT=${APACHE_PHP_UPSTREAM_TIMEOUT}
- DOCUMENT_ROOT=${APACHE_DOCUMENT_ROOT}
- APACHE_INSTALL_HTTP2=${APACHE_INSTALL_HTTP2}
- 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