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

Refactor PHP extension install procedure and remove build dependencies #159

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 40 additions & 11 deletions apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,51 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
git \
wget \
sudo \
libc-client-dev \
libicu-dev \
libkrb5-dev \
libmcrypt-dev \
libssl-dev \
libz-dev \
unzip \
zip \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/* \
&& rm /etc/cron.daily/*

RUN docker-php-ext-configure imap --with-imap --with-imap-ssl --with-kerberos \
&& docker-php-ext-configure opcache --enable-opcache \
&& docker-php-ext-install imap intl mbstring mcrypt mysqli pdo_mysql zip opcache bcmath\
&& docker-php-ext-enable imap intl mbstring mcrypt mysqli pdo_mysql zip opcache bcmath
# Install PHP extensions
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libc-client-dev \
libicu-dev \
libkrb5-dev \
libmcrypt-dev \
libssl-dev \
libz-dev \
; \
\
docker-php-ext-configure imap --with-imap --with-imap-ssl --with-kerberos; \
docker-php-ext-install -j "$(nproc)" \
bcmath \
imap \
intl \
mcrypt \
mysqli \
opcache \
pdo_mysql \
zip \
; \
\
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { print $3 }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*

# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
Expand Down
48 changes: 38 additions & 10 deletions beta-apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,49 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
git \
wget \
sudo \
libc-client-dev \
libicu-dev \
libkrb5-dev \
libssl-dev \
libz-dev \
unzip \
zip \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/* \
&& rm /etc/cron.daily/*

RUN docker-php-ext-configure imap --with-imap --with-imap-ssl --with-kerberos \
&& docker-php-ext-configure opcache --enable-opcache \
&& docker-php-ext-install imap intl mbstring mysqli pdo_mysql zip opcache bcmath \
&& docker-php-ext-enable imap intl mbstring mysqli pdo_mysql zip opcache bcmath
# Install PHP extensions
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libc-client-dev \
libicu-dev \
libkrb5-dev \
libssl-dev \
libz-dev \
; \
\
docker-php-ext-configure imap --with-imap --with-imap-ssl --with-kerberos; \
docker-php-ext-install -j "$(nproc)" \
bcmath \
imap \
intl \
mysqli \
opcache \
pdo_mysql \
zip \
; \
\
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { print $3 }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*

# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
Expand Down
48 changes: 38 additions & 10 deletions beta-fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,49 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
git \
wget \
sudo \
libc-client-dev \
libicu-dev \
libkrb5-dev \
libssl-dev \
libz-dev \
unzip \
zip \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/* \
&& rm /etc/cron.daily/*

RUN docker-php-ext-configure imap --with-imap --with-imap-ssl --with-kerberos \
&& docker-php-ext-configure opcache --enable-opcache \
&& docker-php-ext-install imap intl mbstring mysqli pdo_mysql zip opcache bcmath \
&& docker-php-ext-enable imap intl mbstring mysqli pdo_mysql zip opcache bcmath
# Install PHP extensions
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libc-client-dev \
libicu-dev \
libkrb5-dev \
libssl-dev \
libz-dev \
; \
\
docker-php-ext-configure imap --with-imap --with-imap-ssl --with-kerberos; \
docker-php-ext-install -j "$(nproc)" \
bcmath \
imap \
intl \
mysqli \
opcache \
pdo_mysql \
zip \
; \
\
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { print $3 }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*

# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
Expand Down
51 changes: 40 additions & 11 deletions fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,51 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
git \
wget \
sudo \
libc-client-dev \
libicu-dev \
libkrb5-dev \
libmcrypt-dev \
libssl-dev \
libz-dev \
unzip \
zip \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/* \
&& rm /etc/cron.daily/*

RUN docker-php-ext-configure imap --with-imap --with-imap-ssl --with-kerberos \
&& docker-php-ext-configure opcache --enable-opcache \
&& docker-php-ext-install imap intl mbstring mcrypt mysqli pdo_mysql zip opcache bcmath \
&& docker-php-ext-enable imap intl mbstring mcrypt mysqli pdo_mysql zip opcache bcmath
# Install PHP extensions
RUN set -ex; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libc-client-dev \
libicu-dev \
libkrb5-dev \
libmcrypt-dev \
libssl-dev \
libz-dev \
; \
\
docker-php-ext-configure imap --with-imap --with-imap-ssl --with-kerberos; \
docker-php-ext-install -j "$(nproc)" \
bcmath \
imap \
intl \
mcrypt \
mysqli \
opcache \
pdo_mysql \
zip \
; \
\
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { print $3 }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*

# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
Expand Down