poprawki w drone, iconv fix, net-snmp fix
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
Aleksander Cynarski 2022-06-04 22:00:23 +02:00
parent 1295514340
commit f0146f83a2
Signed by: paramah
GPG Key ID: C4340BA42B9C173A
3 changed files with 78 additions and 15 deletions

View File

@ -11,8 +11,12 @@ steps:
from_secret: hub_password from_secret: hub_password
repo: repo:
from_secret: hub_repo from_secret: hub_repo
platforms:
- linux/amd64
- linux/arm64
- linux/arm/v7
build_args: build_args:
- PHP_VERSION=8.1-fpm-alpine3.15 - PHP_VERSION=8.1-fpm-alpine3.16
tags: 8.1-alpine tags: 8.1-alpine
when: when:
branch: branch:
@ -28,8 +32,12 @@ steps:
from_secret: hub_password from_secret: hub_password
repo: repo:
from_secret: hub_repo from_secret: hub_repo
platforms:
- linux/amd64
- linux/arm64
- linux/arm/v7
build_args: build_args:
- PHP_VERSION=8.0-fpm-alpine3.15 - PHP_VERSION=8.0-fpm-alpine3.16
tags: 8.0-alpine tags: 8.0-alpine
when: when:
branch: branch:
@ -45,8 +53,12 @@ steps:
from_secret: hub_password from_secret: hub_password
repo: repo:
from_secret: hub_repo from_secret: hub_repo
platforms:
- linux/amd64
- linux/arm64
- linux/arm/v7
build_args: build_args:
- PHP_VERSION=7.4-fpm-alpine3.15 - PHP_VERSION=7.4-fpm-alpine3.16
tags: 7.4-alpine tags: 7.4-alpine
when: when:
branch: branch:

View File

@ -1,4 +1,4 @@
ARG PHP_VERSION=7.4-fpm-alpine3.13 ARG PHP_VERSION=8.1-fpm-alpine3.15
FROM paramah/base:alpine as base-config FROM paramah/base:alpine as base-config
@ -8,7 +8,7 @@ FROM paramah/base:alpine as base-config
#================================================== #==================================================
FROM php:${PHP_VERSION} as builder FROM php:${PHP_VERSION} as builder
RUN apk add --no-cache --virtual build-essentials \ RUN apk add --no-cache --virtual build-essentials build-base \
icu-dev icu-libs zlib-dev g++ make automake autoconf libzip-dev \ icu-dev icu-libs zlib-dev g++ make automake autoconf libzip-dev \
libpng-dev libwebp-dev libjpeg-turbo-dev freetype-dev \ libpng-dev libwebp-dev libjpeg-turbo-dev freetype-dev \
wget \ wget \
@ -32,7 +32,11 @@ RUN apk add --no-cache --virtual build-essentials \
freetype-dev \ freetype-dev \
libpng-dev \ libpng-dev \
jpeg-dev \ jpeg-dev \
libjpeg-turbo-dev libjpeg-turbo-dev \
libssh2-dev \
net-snmp \
net-snmp-dev \
gnu-libiconv
COPY docker/ / COPY docker/ /
@ -50,7 +54,7 @@ ARG ENVIRONMENT=production
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && apk update RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && apk update
# install system libs # install system libs
RUN apk add --no-cache libintl c-client libpng icu-libs libldap libpq libjpeg libwebp freetype libzip shadow sudo wget bash git openssh supervisor nginx openssl zip fluent-bit \ RUN apk add --no-cache libintl c-client gnu-libiconv net-snmp libpng icu-libs libldap libpq libjpeg libwebp freetype libzip shadow sudo wget bash git openssh supervisor nginx openssl zip fluent-bit \
&& apk --no-cache upgrade && rm -rf /var/cache/apk/* && apk --no-cache upgrade && rm -rf /var/cache/apk/*
ENV DIR /var/www ENV DIR /var/www

View File

@ -1,7 +1,35 @@
#!/bin/bash #!/bin/bash
set -eo pipefail
shopt -s nullglob
shopt -s dotglob
PHP_VERSION=`php -r 'echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;'` PHP_VERSION=`php -r 'echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;'`
PHP_MODULES=("calendar" "bcmath" "bz2" "curl" "fileinfo" "gettext" "iconv" "imap" "intl" "ldap" "mbstring" "opcache" "pcntl" "pdo" "pdo_mysql" "pdo_pgsql" "pdo_sqlite" "pgsql" "phar" "session" "simplexml" "soap" "xml", "zip") PHP_MODULES=(
"calendar"
"bcmath"
"bz2"
"curl"
"fileinfo"
"gettext"
"imap"
"intl"
"ldap"
"mbstring"
"opcache"
"pcntl"
"pdo"
"pdo_mysql"
"pdo_pgsql"
"pdo_sqlite"
"pgsql"
"phar"
"session"
"simplexml"
"soap"
"xml"
"zip"
"snmp"
)
# #
# Helper functions # Helper functions
@ -25,11 +53,21 @@ h2() {
h1 "Configure PHP modules" h1 "Configure PHP modules"
case $PHP_VERSION in case $PHP_VERSION in
'80' ) '81' )
h2 "[php8] Configure and install GD" h2 "[php8.1] Configure and install GD"
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --enable-gd docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp
docker-php-ext-install -j$(nproc) gd docker-php-ext-install -j$(nproc) gd
h1 "Install iconv extension"
apk add --no-cache --virtual php81-iconv
;;
'80' )
h2 "[php8.0] Configure and install GD"
docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp
docker-php-ext-install -j$(nproc) gd
h2 "Install ssh module"
docker-php-ext-install -j$(nproc) ssh
h1 "Install iconv extension"
apk add --no-cache --virtual php8-iconv
;; ;;
'74' ) '74' )
h2 "[php74] Configure and install GD" h2 "[php74] Configure and install GD"
@ -37,6 +75,12 @@ case $PHP_VERSION in
docker-php-ext-install -j$(nproc) gd docker-php-ext-install -j$(nproc) gd
h2 "Install json module" h2 "Install json module"
docker-php-ext-install -j$(nproc) json docker-php-ext-install -j$(nproc) json
h2 "Install memcache module"
docker-php-ext-install -j$(nproc) memcache
h2 "Install ssh module"
docker-php-ext-install -j$(nproc) ssh
h1 "Install iconv extension"
apk add --no-cache --virtual php7-iconv
;; ;;
* ) * )
h2 "Configure and install GD" h2 "Configure and install GD"
@ -52,8 +96,11 @@ case $PHP_VERSION in
esac esac
h1 "Install PHP modules" h1 "Install PHP modules"
for module in "${PHP_MODULES[@]}" for i in "${!PHP_MODULES[@]}"
do do
h1 "Install module: ${module}" num=$((i+1))
docker-php-ext-install -j$(nproc) $module h1 " (${num}/${#PHP_MODULES[@]}) > Install module: ${PHP_MODULES[$i]}"
h2 " Check modules"
docker-php-ext-install -j$(nproc) ${PHP_MODULES[$i]}
done done