Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from upstream #2

Merged
merged 10 commits into from Sep 17, 2020
3 changes: 1 addition & 2 deletions php/scripts/alpine/cleanup.sh
@@ -1,12 +1,11 @@
#!/usr/bin/env bash

set -euf -o pipefail
set -euo pipefail

apk del --purge grep build-base file openssl-dev

rm -rf /tmp/* \
/usr/includes/* \
/usr/share/man/* \
/usr/src/* \
/var/cache/apk/* \
/var/tmp/*
2 changes: 1 addition & 1 deletion php/scripts/alpine/extensions.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -euf -o pipefail
set -euo pipefail

apk --update --no-cache add \
bzip2 \
Expand Down
6 changes: 3 additions & 3 deletions php/scripts/alpine/nodeyarn.sh
@@ -1,13 +1,13 @@
#!/usr/bin/env bash

set -euo pipefail

ln -s /usr/lib/npm/bin/npm-cli.js /usr/bin/npm

npm i -g npm@${NPM_VERSION}
npm i -g --force npm@${NPM_VERSION}

curl -o- -L https://yarnpkg.com/install.sh | bash

mkdir $HOME/.config

rm -rf /usr/share/man /var/cache/apk/* \
/root/.npm /root/.node-gyp /root/.gnupg /usr/lib/node_modules/npm/man \
/usr/lib/node_modules/npm/doc /usr/lib/node_modules/npm/html /usr/lib/node_modules/npm/scripts
2 changes: 1 addition & 1 deletion php/scripts/alpine/packages.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -euf -o pipefail
set -euo pipefail

apk --update --no-cache add \
g++ \
Expand Down
5 changes: 3 additions & 2 deletions php/scripts/chromium.sh
@@ -1,9 +1,10 @@
#!/bin/bash

set -euf -o pipefail
set -euo pipefail

# Installing Chromium for Dusk
DEBIAN_FRONTEND=noninteractive apt-get install -yqq \
apt-get update \
&& apt-get install -yq \
libgconf-2-4 \
libnss3 \
libxi6 \
Expand Down
8 changes: 5 additions & 3 deletions php/scripts/cleanup.sh
@@ -1,6 +1,8 @@
#!/usr/bin/env bash

apt-get purge -yqq --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \
set -euo pipefail

apt-get purge -yq --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false \
apt-utils \
build-essential \
dpkg-dev \
Expand All @@ -12,7 +14,7 @@ apt-get purge -yqq --auto-remove -o APT::AutoRemove::RecommendsImportant=false -
re2c \
wget

apt-get autoremove -yqq --purge
apt-get autoclean -yqq
apt-get autoremove -yq --purge
apt-get autoclean -yq
apt-get clean
rm -rf /var/cache/apt/ /var/lib/apt/lists/* /var/log/* /tmp/* /var/tmp/* /usr/share/doc /usr/share/doc-base /usr/share/groff/* /usr/share/info/* /usr/share/linda/* /usr/share/lintian/overrides/* /usr/share/locale/* /usr/share/man/* /usr/share/locale/* /usr/share/gnome/help/*/* /usr/share/doc/kde/HTML/*/* /usr/share/omf/*/*-*.emf
78 changes: 41 additions & 37 deletions php/scripts/extensions.sh
@@ -1,34 +1,36 @@
#!/usr/bin/env bash

set -euf -o pipefail

extensions=" \
bcmath \
bz2 \
calendar \
exif \
gmp \
intl \
mysqli \
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
pgsql \
soap \
xmlrpc \
xsl \
zip
"
set -euo pipefail

export extensions=" \
bcmath \
bz2 \
calendar \
exif \
gmp \
intl \
mysqli \
opcache \
pcntl \
pdo_mysql \
pdo_pgsql \
pgsql \
soap \
xmlrpc \
xsl \
zip
"

if [[ $PHP_VERSION == "7.4" || $PHP_VERSION == "7.3" || $PHP_VERSION == "7.2" ]]; then
buildDeps=" \

export buildDeps=" \
default-libmysqlclient-dev \
libbz2-dev \
libsasl2-dev \
pkg-config \
" \
runtimeDeps=" \
"

export runtimeDeps=" \
imagemagick \
libfreetype6-dev \
libgmp-dev \
Expand All @@ -44,18 +46,21 @@ if [[ $PHP_VERSION == "7.4" || $PHP_VERSION == "7.3" || $PHP_VERSION == "7.2" ]]
librabbitmq-dev \
libssl-dev \
libuv1-dev \
libwebp-dev \
libxml2-dev \
libzip-dev \
libxslt1-dev \
libzip-dev \
multiarch-support \
"
else
buildDeps=" \

export buildDeps=" \
default-libmysqlclient-dev \
libbz2-dev \
libsasl2-dev \
" \
runtimeDeps=" \
"

export runtimeDeps=" \
imagemagick \
libfreetype6-dev \
libgmp-dev \
Expand All @@ -71,30 +76,29 @@ else
libpq-dev \
librabbitmq-dev \
libuv1-dev \
libwebp-dev \
libxml2-dev \
mcrypt \
multiarch-support \
"
fi

apt-get update \
&& apt-get install -yq $buildDeps \
&& apt-get install -yq $runtimeDeps \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install -j$(nproc) $extensions

if [[ $PHP_VERSION == "7.4" ]]; then
DEBIAN_FRONTEND=noninteractive apt-get install -yqq $buildDeps \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yqq $runtimeDeps \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install -j$(nproc) $extensions \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
&& docker-php-ext-install -j$(nproc) ldap \
&& PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
&& docker-php-ext-install -j$(nproc) imap \
&& docker-php-source delete
else
DEBIAN_FRONTEND=noninteractive apt-get install -yqq $buildDeps \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yqq $runtimeDeps \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install -j$(nproc) $extensions \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-webp-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
&& docker-php-ext-install -j$(nproc) ldap \
Expand Down
6 changes: 3 additions & 3 deletions php/scripts/node.sh
@@ -1,11 +1,11 @@
#!/usr/bin/env bash

set -euf -o pipefail
set -euo pipefail

# NODE JS
curl -sL https://deb.nodesource.com/setup_12.x | bash - \
&& DEBIAN_FRONTEND=noninteractive apt-get install nodejs -yqq \
&& npm i -g npm \
&& DEBIAN_FRONTEND=noninteractive apt-get install nodejs -yq \
&& npm i -g --force npm \
&& curl -o- -L https://yarnpkg.com/install.sh | bash \
&& npm cache clean --force

Expand Down
9 changes: 4 additions & 5 deletions php/scripts/packages.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -euf -o pipefail
set -euo pipefail

############################################################
# Speedup DPKG and don't use cache for packages
Expand All @@ -10,19 +10,18 @@ set -euf -o pipefail
# this forces dpkg not to call sync() after package extraction and speeds up
# install
echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup
#
# we don't need and apt cache in a container
echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf
export DEBIAN_FRONTEND=noninteractive

DEBIAN_FRONTEND=noninteractive
dpkg-reconfigure -f noninteractive tzdata \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yqq \
&& apt-get install -yq \
apt-transport-https \
apt-utils \
ca-certificates \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yqq \
&& apt-get install -yq \
build-essential \
curl \
git \
Expand Down