mirror of
https://github.com/QYG2297248353/appstore-1panel.git
synced 2026-06-16 01:02:14 +08:00
fix: 解决部分 php 版本构建失败的问题
This commit is contained in:
@@ -5,26 +5,25 @@ ARG TZ
|
||||
ARG PHP_EXTENSIONS
|
||||
ARG CONTAINER_PACKAGE_URL
|
||||
|
||||
RUN if [ $CONTAINER_PACKAGE_URL ] ; then sed -i "s/http://dl-cdn.alpinelinux.org/https://${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories ; fi
|
||||
|
||||
RUN if [ $CONTAINER_PACKAGE_URL ] ; then sed -i "s/dl-cdn.alpinelinux.org/${CONTAINER_PACKAGE_URL}/g" /etc/apk/repositories ; fi
|
||||
|
||||
ADD ./extensions/install-php-extensions /usr/local/bin/
|
||||
|
||||
RUN chmod uga+x /usr/local/bin/install-php-extensions
|
||||
|
||||
COPY ./extensions /tmp/extensions
|
||||
WORKDIR /tmp/extensions
|
||||
RUN chmod +x install.sh \
|
||||
&& sh install.sh \
|
||||
&& rm -rf /tmp/extensions
|
||||
&& sh install.sh
|
||||
|
||||
ADD ./extensions/install-php-extensions /usr/local/bin/
|
||||
|
||||
RUN chmod uga+x /usr/local/bin/install-php-extensions
|
||||
|
||||
RUN apk --no-cache add tzdata \
|
||||
&& cp "/usr/share/zoneinfo/$TZ" /etc/localtime \
|
||||
&& echo "$TZ" > /etc/timezone
|
||||
|
||||
|
||||
# Fix: https://github.com/docker-library/php/issues/240
|
||||
RUN apk add gnu-libiconv libstdc++ --no-cache --repository http://${CONTAINER_PACKAGE_URL}/alpine/edge/community/ --allow-untrusted
|
||||
# Fix: https://github.com/docker-library/php/issues/1121
|
||||
RUN apk add --no-cache --repository http://${CONTAINER_PACKAGE_URL}/alpine/v3.13/community/ gnu-libiconv=1.15-r3
|
||||
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
|
||||
|
||||
|
||||
@@ -37,4 +36,4 @@ ENV COMPOSER_HOME=/tmp/composer
|
||||
RUN apk --no-cache add shadow && usermod -u 1000 www-data && groupmod -g 1000 www-data
|
||||
|
||||
|
||||
WORKDIR /www
|
||||
WORKDIR /www
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
# The latest mirror's composer version only support for PHP 7.2.5
|
||||
# The latest mirror's composer version only support for PHP 5.6.0
|
||||
# And if your PHP version is lesser than that, will be download supported version.
|
||||
supportLatest=$(php -r "echo version_compare(PHP_VERSION, '7.2.5', '>');")
|
||||
supportLatest=$(php -r "echo version_compare(PHP_VERSION, '5.5.0', '>');")
|
||||
|
||||
if [ "$supportLatest" -eq "1" ]; then
|
||||
curl -o /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar \
|
||||
|
||||
Reference in New Issue
Block a user