diff --git a/doc/docker/fpm/Dockerfile b/doc/docker/fpm/Dockerfile index af7bf66dea..5cc8965812 100644 --- a/doc/docker/fpm/Dockerfile +++ b/doc/docker/fpm/Dockerfile @@ -17,7 +17,7 @@ RUN apt-get update \ && apt-get install -y software-properties-common \ && LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php \ && apt-get update \ - && bash -c "apt-get install -y php$PHP_VERSION-{cli,mysql,json,gd,xsl,bz2,opcache,apcu,tidy,zip,bcmath,mbstring,smbclient,ldap,curl,fpm,pgsql,gmp}" \ + && bash -c "apt-get install -y php$PHP_VERSION-{cli,mysql,json,gd,xsl,bz2,opcache,apcu,tidy,zip,bcmath,mbstring,smbclient,ldap,curl,fpm,pgsql,gmp,memcached}" \ # fpm and php.ini settings && sed -e 's/^;\?listen \?=.*/listen = 9000/g' \ -e '/allowed_clients/d' \ diff --git a/doc/docker/fpm/build.sh b/doc/docker/fpm/build.sh index 7f6ce00350..7ec4111e6b 100755 --- a/doc/docker/fpm/build.sh +++ b/doc/docker/fpm/build.sh @@ -1,5 +1,16 @@ #!/bin/bash -x +cd $(dirname $0) + +DEFAULT_PHP_VERSION=7.4 +PHP_VERSION=$DEFAULT_PHP_VERSION + +if [[ $1 =~ ^[78]\.[0-9]$ ]] +then + PHP_VERSION=$1 + shift +fi + DEFAULT=$(git branch|grep ^*|cut -c3-) TAG=${1:-$DEFAULT} VERSION=$TAG @@ -15,18 +26,21 @@ BRANCH=$(echo $VERSION|sed 's/\.[0-9]\{8\}$//') } } -cd $(dirname $0) +# add PHP_VERSION to TAG, if not the default PHP version +[ $PHP_VERSION != $DEFAULT_PHP_VERSION ] && TAG=$TAG-$PHP_VERSION docker pull ubuntu:20.04 -docker build --no-cache --build-arg "VERSION=$VERSION" -t egroupware/egroupware:$TAG . && { +docker build --no-cache --build-arg "VERSION=$VERSION" --build-arg "PHP_VERSION=$PHP_VERSION" -t egroupware/egroupware:$TAG . && { docker push egroupware/egroupware:$TAG + # further tags are only for the default PHP version + [ $PHP_VERSION != $DEFAULT_PHP_VERSION ] && exit # tag only stable releases as latest - #[ $TAG != "master" ] && { - # docker tag egroupware/egroupware:$TAG egroupware/egroupware:latest - # docker push egroupware/egroupware:latest - #} + [ $TAG != "master" ] && { + docker tag egroupware/egroupware:$TAG egroupware/egroupware:latest + docker push egroupware/egroupware:latest + } [ "$BRANCH" != $VERSION -a "${BRANCH}.x-dev" != $VERSION ] && { - docker tag egroupware/egroupware:$VERSION egroupware/egroupware:$BRANCH + docker tag egroupware/egroupware:$TAG egroupware/egroupware:$BRANCH docker push egroupware/egroupware:$BRANCH } }