Compare commits

...

26 Commits
7.4.29 ... main

Author SHA1 Message Date
Tinywan
6387096477 FROM php:8.2.11-cli-alpine 2023-10-11 18:21:15 +08:00
Tinywan
f43b24dd3f Merge branch 'main' of github.com:Tinywan/docker-php-webman 2023-10-11 17:45:26 +08:00
Tinywan
dc7ff46b2c updaet 2023-10-11 17:45:21 +08:00
ShaoBo Wan(無尘)
46c802b512
Update Dockerfile 2023-10-11 16:23:09 +08:00
ShaoBo Wan(無尘)
d501b3383e
Update docker-publish.yml 2023-10-11 16:20:46 +08:00
ShaoBo Wan(無尘)
90484d4e56
Update docker-publish.yml ubuntu-18.04 2023-10-11 16:13:01 +08:00
ShaoBo Wan(無尘)
dae6b06b07
php:8.1.24-cli-alpine 2023-10-11 16:10:43 +08:00
ShaoBo Wan(無尘)
542e2ea963
Update Dockerfile 2023-10-11 13:02:13 +08:00
ShaoBo Wan(無尘)
ea168ccb29
SHELL ["/bin/bash", "-c"] 2023-10-11 11:29:58 +08:00
ShaoBo Wan(無尘)
3553bcbadc
Update Dockerfile 2023-10-11 11:27:02 +08:00
ShaoBo Wan(無尘)
e5c120d9bd
Update Dockerfile 8.2.11-cli-alpine 2023-10-11 11:25:12 +08:00
ShaoBo Wan(無尘)
f74837627e
8.2.11-cli-alpine 2023-10-11 11:22:09 +08:00
ShaoBo Wan(無尘)
c243b0a514
Update Dockerfile 2023-01-08 13:23:43 +08:00
ShaoBo Wan(無尘)
47df4854ae
Update docker-publish.yml 2023-01-08 13:22:26 +08:00
ShaoBo Wan(無尘)
0061d33926
Update Dockerfile 2023-01-08 13:13:57 +08:00
ShaoBo Wan(無尘)
ce1b1581c0
Update Dockerfile 2023-01-08 13:11:04 +08:00
ShaoBo Wan(無尘)
fbbb7f306f
FROM php:8.2.1-cli 2023-01-08 13:03:40 +08:00
ShaoBo Wan(無尘)
f6817b7002
php:7.4.33-cli-alpine 2023-01-08 12:57:34 +08:00
ShaoBo Wan(無尘)
550c759357
Update Dockerfile 2023-01-08 12:55:19 +08:00
ShaoBo Wan(無尘)
7775b98393
Update Dockerfile 2023-01-08 12:52:15 +08:00
ShaoBo Wan(無尘)
d4ff2508e6
PHP 8.2.0 2023-01-08 12:49:55 +08:00
ShaoBo Wan(無尘)
0c67edc0b5
Update Dockerfile 2023-01-08 12:41:25 +08:00
ShaoBo Wan(無尘)
1d408ec839
Update Dockerfile 2022-12-27 09:46:18 +08:00
ShaoBo Wan(無尘)
ad42a129cd
Update Dockerfile 2022-12-27 09:45:47 +08:00
ShaoBo Wan(無尘)
94be652c96
Update Dockerfile 2022-12-23 14:41:43 +08:00
万少波
b6714d2eb4 8.2.0 2022-12-19 15:31:29 +08:00
4 changed files with 170 additions and 129 deletions

View File

@ -25,7 +25,7 @@ env:
jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-last
permissions:
contents: read
packages: write
@ -38,7 +38,7 @@ jobs:
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
@ -48,14 +48,14 @@ jobs:
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
uses: docker/metadata-action@v2
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name != 'pull_request' }}

View File

@ -1,16 +1,19 @@
FROM php:7.4.29-cli-alpine
# FROM php:8.1.4-cli-alpine
#FROM php:7.4.33-cli-alpine
# FROM php:8.1.24-cli
FROM php:8.2.11-cli-alpine
LABEL Maintainer="ShaoBo Wan (Tinywan) <756684177@qq.com>" \
Description="Webman Lightweight container with PHP 8.1.4 based on Alpine Linux."
Description="Webman Lightweight container with PHP 8.2.11 based on Alpine Linux."
# Container package : mirrors.163.com、mirrors.aliyun.com、mirrors.ustc.edu.cn
RUN sed -i "s/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g" /etc/apk/repositories
RUN cat /etc/issue
# Add basics first
RUN apk update && apk upgrade && apk add \
bash curl ca-certificates openssl openssh git nano libxml2-dev tzdata icu-dev openntpd libedit-dev libzip-dev libjpeg-turbo-dev libpng-dev freetype-dev \
autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c pcre-dev openssl-dev libffi-dev libressl-dev libevent-dev zlib-dev libtool automake \
supervisor
RUN apk update && apk add bash curl ca-certificates openssl openssh git nano libxml2-dev tzdata icu-dev openntpd libedit-dev libzip-dev libjpeg-turbo-dev libpng-dev freetype-dev autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c pcre-dev libffi-dev libressl-dev libevent-dev zlib-dev libtool automake supervisor
# RUN apt-get update && apt-get upgrade && apt-get install bash curl ca-certificates openssl openssh git nano libxml2-dev tzdata icu-dev openntpd libedit-dev libzip-dev libjpeg-turbo-dev libpng-dev freetype-dev autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c pcre-dev openssl-dev libffi-dev libressl-dev libevent-dev zlib-dev libtool automake supervisor
COPY ./extension /tmp/extension
WORKDIR /tmp/extension
@ -46,7 +49,7 @@ USER root
WORKDIR /app
# Expose the port nginx is reachable on
EXPOSE 8080
EXPOSE 8787
# Let supervisord start nginx & php
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

View File

@ -106,3 +106,48 @@ docker rmi -f $(docker images -qa)
## dos2unix install.sh
```
=> ERROR [ 7/14] RUN chmod +x install.sh && sh install.sh && rm -rf /tmp/extension 0.2s
------
> [ 7/14] RUN chmod +x install.sh && sh install.sh && rm -rf /tmp/extension:
: not foundll.sh: line 1: #!/bin/sh
: not foundll.sh: line 2:
: not foundll.sh: line 4:
: not foundll.sh: line 10: echo
: not foundll.sh: line 11:
: not foundll.sh: line 13:
: not foundll.sh: line 30:
0.217 install.sh: return: line 36: Illegal number: 0
```
查看文本格式
```
$ cat -A install.sh
M-oM-;M-?#!/bin/sh^M$
^M$
export MC="-j$(nproc)"^M$
^M$
echo "============================================"^M$
echo "Install extensions from : install.sh"^M$
echo "PHP version : ${PHP_VERSION}"^M$
echo "Work directory : ${PWD}"^M$
echo "============================================"^M$
echo^M$
^M$
export EXTENSIONS="gd,bcmath,pdo,mysqli,pdo_mysql,redis,bz2,calendar,opcache,pcntl,sockets,amqp,zip,soap,event,"^M$
^M$
#^M$
# Check if current php version is greater than or equal to^M$
# specific version.^M$
#^M$
# For example, to check if current php is greater than or^M$
# equal to PHP 7.0:^M$
#^M$
# isPhpVersionGreaterOrEqual 8 0^M$
#^M$
# Param 1: Specific PHP Major version^M$
# Param 2: Specific PHP Minor version^M$
# Return : 1 if greater than or equal to, 0 if less than^M$
```
> dos2unix install.sh 转换

View File

@ -2,7 +2,6 @@
export MC="-j$(nproc)"
echo
echo "============================================"
echo "Install extensions from : install.sh"
echo "PHP version : ${PHP_VERSION}"
@ -10,7 +9,7 @@ echo "Work directory : ${PWD}"
echo "============================================"
echo
export EXTENSIONS=",gd,bcmath,pdo,mysqli,pdo_mysql,redis,bz2,calendar,opcache,pcntl,sockets,amqp,zip,soap,event,"
export EXTENSIONS="gd,bcmath,pdo,mysqli,pdo_mysql,redis,bz2,calendar,opcache,pcntl,sockets,amqp,zip,soap,event,"
#
# Check if current php version is greater than or equal to
@ -19,25 +18,24 @@ export EXTENSIONS=",gd,bcmath,pdo,mysqli,pdo_mysql,redis,bz2,calendar,opcache,pc
# For example, to check if current php is greater than or
# equal to PHP 7.0:
#
# isPhpVersionGreaterOrEqual 7 0
# isPhpVersionGreaterOrEqual 8 0
#
# Param 1: Specific PHP Major version
# Param 2: Specific PHP Minor version
# Return : 1 if greater than or equal to, 0 if less than
#
isPhpVersionGreaterOrEqual()
{
local PHP_MAJOR_VERSION=$(php -r "echo PHP_MAJOR_VERSION;")
local PHP_MINOR_VERSION=$(php -r "echo PHP_MINOR_VERSION;")
isPhpVersionGreaterOrEqual() {
# local PHP_MAJOR_VERSION=$(php -r "echo PHP_MAJOR_VERSION;")
# local PHP_MINOR_VERSION=$(php -r "echo PHP_MINOR_VERSION;")
if [[ "$PHP_MAJOR_VERSION" -gt "$1" || "$PHP_MAJOR_VERSION" -eq "$1" && "$PHP_MINOR_VERSION" -ge "$2" ]]; then
return 1;
else
return 0;
fi
# if [[ "$PHP_MAJOR_VERSION" -gt "$1" || "$PHP_MAJOR_VERSION" -eq "$1" && "$PHP_MINOR_VERSION" -ge "$2" ]]; then
# return 1;
# else
# return 0;
# fi
return 0
}
#
# Install extension from package file(.tgz),
# For example:
@ -47,8 +45,7 @@ isPhpVersionGreaterOrEqual()
# Param 1: Package name with version
# Param 2: enable options
#
installExtensionFromTgz()
{
installExtensionFromTgz() {
tgzName=$1
extensionName="${tgzName%%-*}"
@ -59,7 +56,6 @@ installExtensionFromTgz()
docker-php-ext-enable ${extensionName} $2
}
if [[ -z "${EXTENSIONS##*,pdo_mysql,*}" ]]; then
echo "---------- Install pdo_mysql ----------"
docker-php-ext-install ${MC} pdo_mysql
@ -158,14 +154,14 @@ fi
if [[ -z "${EXTENSIONS##*,pdo_pgsql,*}" ]]; then
echo "---------- Install pdo_pgsql ----------"
apk --no-cache add postgresql-dev \
&& docker-php-ext-install ${MC} pdo_pgsql
apk --no-cache add postgresql-dev &&
docker-php-ext-install ${MC} pdo_pgsql
fi
if [[ -z "${EXTENSIONS##*,pgsql,*}" ]]; then
echo "---------- Install pgsql ----------"
apk --no-cache add postgresql-dev \
&& docker-php-ext-install ${MC} pgsql
apk --no-cache add postgresql-dev &&
docker-php-ext-install ${MC} pgsql
fi
if [[ -z "${EXTENSIONS##*,oci8,*}" ]]; then
@ -191,7 +187,7 @@ fi
if [[ -z "${EXTENSIONS##*,gd,*}" ]]; then
echo "---------- Install gd ----------"
isPhpVersionGreaterOrEqual 7 4
isPhpVersionGreaterOrEqual 8 0
if [[ "$?" = "1" ]]; then
# "--with-xxx-dir" was removed from php 7.4,
@ -208,10 +204,10 @@ if [[ -z "${EXTENSIONS##*,gd,*}" ]]; then
libpng-dev \
libjpeg-turbo \
libjpeg-turbo-dev \
libwebp-dev \
&& docker-php-ext-configure gd ${options} \
&& docker-php-ext-install ${MC} gd \
&& apk del \
libwebp-dev &&
docker-php-ext-configure gd ${options} &&
docker-php-ext-install ${MC} gd &&
apk del \
freetype-dev \
libpng-dev \
libjpeg-turbo-dev
@ -351,9 +347,8 @@ if [[ -z "${EXTENSIONS##*,igbinary,*}" ]]; then
docker-php-ext-enable igbinary
fi
if [[ -z "${EXTENSIONS##*,yac,*}" ]]; then
isPhpVersionGreaterOrEqual 7 0
isPhpVersionGreaterOrEqual 8 0
if [[ "$?" = "1" ]]; then
echo "---------- Install yac ----------"
printf "\n" | pecl install yac-2.0.2
@ -375,9 +370,8 @@ if [[ -z "${EXTENSIONS##*,yar,*}" ]]; then
fi
if [[ -z "${EXTENSIONS##*,yaconf,*}" ]]; then
isPhpVersionGreaterOrEqual 7 0
isPhpVersionGreaterOrEqual 8 0
if [[ "$?" = "1" ]]; then
echo "---------- Install yaconf ----------"
printf "\n" | pecl install yaconf
@ -401,7 +395,7 @@ if [[ -z "${EXTENSIONS##*,varnish,*}" ]]; then
fi
if [[ -z "${EXTENSIONS##*,pdo_sqlsrv,*}" ]]; then
isPhpVersionGreaterOrEqual 7 1
isPhpVersionGreaterOrEqual 8 0
if [[ "$?" = "1" ]]; then
echo "---------- Install pdo_sqlsrv ----------"
apk add --no-cache unixodbc-dev
@ -435,13 +429,13 @@ if [[ -z "${EXTENSIONS##*,mcrypt,*}" ]]; then
docker-php-ext-enable mcrypt
else
echo "---------- Install mcrypt ----------"
apk add --no-cache libmcrypt-dev \
&& docker-php-ext-install ${MC} mcrypt
apk add --no-cache libmcrypt-dev &&
docker-php-ext-install ${MC} mcrypt
fi
fi
if [[ -z "${EXTENSIONS##*,mysql,*}" ]]; then
isPhpVersionGreaterOrEqual 7 0
isPhpVersionGreaterOrEqual 8 0
if [[ "$?" = "1" ]]; then
echo "---------- mysql was REMOVED from PHP 7.0.0 ----------"
@ -472,7 +466,7 @@ fi
if [[ -z "${EXTENSIONS##*,redis,*}" ]]; then
echo "---------- Install redis ----------"
isPhpVersionGreaterOrEqual 7 4
isPhpVersionGreaterOrEqual 8 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz redis-5.3.4
else
@ -489,7 +483,7 @@ fi
if [[ -z "${EXTENSIONS##*,memcached,*}" ]]; then
echo "---------- Install memcached ----------"
apk add --no-cache libmemcached-dev zlib-dev
isPhpVersionGreaterOrEqual 7 0
isPhpVersionGreaterOrEqual 8 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install memcached-3.1.3
@ -557,7 +551,6 @@ if [[ -z "${EXTENSIONS##*,yaf,*}" ]]; then
fi
fi
if [[ -z "${EXTENSIONS##*,swoole,*}" ]]; then
echo "---------- Install swoole ----------"
isPhpVersionGreaterOrEqual 7 0
@ -574,7 +567,7 @@ if [[ -z "${EXTENSIONS##*,zip,*}" ]]; then
# Fix: https://github.com/docker-library/php/issues/797
apk add --no-cache libzip-dev
isPhpVersionGreaterOrEqual 7 4
isPhpVersionGreaterOrEqual 8 0
if [[ "$?" != "1" ]]; then
docker-php-ext-configure zip --with-libzip=/usr/include
fi
@ -585,13 +578,13 @@ fi
if [[ -z "${EXTENSIONS##*,xhprof,*}" ]]; then
echo "---------- Install XHProf ----------"
isPhpVersionGreaterOrEqual 7 0
isPhpVersionGreaterOrEqual 8 0
if [[ "$?" = "1" ]]; then
mkdir xhprof \
&& tar -xf xhprof-2.2.0.tgz -C xhprof --strip-components=1 \
&& ( cd xhprof/extension/ && phpize && ./configure && make ${MC} && make install ) \
&& docker-php-ext-enable xhprof
mkdir xhprof &&
tar -xf xhprof-2.2.0.tgz -C xhprof --strip-components=1 &&
(cd xhprof/extension/ && phpize && ./configure && make ${MC} && make install) &&
docker-php-ext-enable xhprof
else
echo "---------- PHP Version>= 7.0----------"
fi
@ -600,7 +593,7 @@ fi
if [[ -z "${EXTENSIONS##*,xlswriter,*}" ]]; then
echo "---------- Install xlswriter ----------"
isPhpVersionGreaterOrEqual 7 0
isPhpVersionGreaterOrEqual 8 0
if [[ "$?" = "1" ]]; then
printf "\n" | pecl install xlswriter
@ -655,17 +648,17 @@ if [[ -z "${EXTENSIONS##*,sdebug,*}" ]]; then
isPhpVersionGreaterOrEqual 7 2
if [[ "$?" = "1" ]]; then
curl -SL "https://github.com/swoole/sdebug/archive/sdebug_2_9-beta.tar.gz" -o sdebug.tar.gz \
&& mkdir -p sdebug \
&& tar -xf sdebug.tar.gz -C sdebug --strip-components=1 \
&& rm sdebug.tar.gz \
&& ( \
cd sdebug \
&& phpize \
&& ./configure --enable-xdebug \
&& make clean && make && make install \
) \
&& docker-php-ext-enable xdebug
curl -SL "https://github.com/swoole/sdebug/archive/sdebug_2_9-beta.tar.gz" -o sdebug.tar.gz &&
mkdir -p sdebug &&
tar -xf sdebug.tar.gz -C sdebug --strip-components=1 &&
rm sdebug.tar.gz &&
(
cd sdebug &&
phpize &&
./configure --enable-xdebug &&
make clean && make && make install
) &&
docker-php-ext-enable xdebug
else
echo "---------- PHP Version>= 7.2----------"
fi
@ -673,7 +666,7 @@ fi
if [[ -z "${EXTENSIONS##*,protobuf,*}" ]]; then
echo "---------- Install protobuf ----------"
isPhpVersionGreaterOrEqual 7 2
isPhpVersionGreaterOrEqual 8 0
if [[ "$?" = "1" ]]; then
installExtensionFromTgz protobuf-3.13.0.1
@ -694,6 +687,6 @@ if [[ -z "${EXTENSIONS##*,grpc,*}" ]]; then
fi
if [ "${PHP_EXTENSIONS}" != "" ]; then
apk del .build-deps \
&& docker-php-source delete
apk del .build-deps &&
docker-php-source delete
fi