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

Convert images to alpine #252

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
76 changes: 42 additions & 34 deletions php/php80/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,24 @@ RUN apk add --no-cache --update \
tzdata \
vim \
wget \
zip \
&& apk add --no-cache --virtual build-dependencies \
zip

RUN apk add --no-cache --update --virtual build-dependencies \
curl-dev \
freetype-dev \
freetds-dev \
libjpeg-turbo-dev \
libmcrypt-dev \
libmemcached-dev \
libpng-dev \
libpq-dev \
libxml2-dev \
libzip-dev \
icu-dev \
openldap-dev \
unixodbc-dev \
gcc \
make \
g++ \
&& docker-php-ext-install -j$(nproc) zip \
g++ && \
docker-php-ext-install -j$(nproc) zip \
intl \
soap \
opcache \
Expand All @@ -61,31 +60,36 @@ RUN apk add --no-cache --update \
mysqli \
exif \
ldap \
pdo_dblib \
&& docker-php-ext-configure gd \
pdo_dblib && \
docker-php-ext-configure gd \
--with-freetype \
--with-jpeg \
&& docker-php-ext-install -j$(nproc) gd
--with-jpeg && \
docker-php-ext-install -j$(nproc) gd && \
apk del build-dependencies

RUN git clone https://github.com/tideways/php-profiler-extension.git \
&& cd php-profiler-extension \
&& phpize \
&& ./configure \
&& make && make install
RUN apk add --no-cache --update --virtual build-dependencies \
gcc \
make \
g++ \
libmemcached-dev \
libzip-dev \
pkgconfig && \
git clone https://github.com/tideways/php-profiler-extension.git && \
cd php-profiler-extension && \
phpize && \
./configure && \
make && make install && \
pecl install -o -f redis && \
pecl install -o -f igbinary && \
pecl install -o -f memcached && \
rm -rf /tmp/pear && \
apk del build-dependencies

RUN echo "extension=tideways_xhprof.so" >> /usr/local/etc/php/conf.d/tideways_xhprof.ini

RUN pecl install -o -f redis \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable redis

RUN pecl install -o -f igbinary \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable igbinary

RUN pecl install -o -f memcached \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable memcached
RUN docker-php-ext-enable redis && \
docker-php-ext-enable igbinary && \
docker-php-ext-enable memcached

ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
Expand All @@ -107,12 +111,19 @@ RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --import - &&
RUN apk add --allow-untrusted msodbcsql18_18.3.1.1-1_$TARGETARCH.apk && \
apk add --allow-untrusted mssql-tools18_18.3.1.1-1_$TARGETARCH.apk

RUN echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bash_profile \
&& echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
RUN echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bash_profile && \
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc

RUN pear config-set php_ini `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` system \
&& pecl install sqlsrv \
&& pecl install pdo_sqlsrv
RUN apk add --no-cache --update --virtual build-dependencies \
gcc \
make \
g++ \
unixodbc-dev && \
pear config-set php_ini `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` system && \
pecl install sqlsrv && \
pecl install pdo_sqlsrv && \
rm -rf /tmp/pear && \
apk del build-dependencies

RUN docker-php-ext-enable sqlsrv.so && docker-php-ext-enable pdo_sqlsrv.so
Comment on lines +117 to 128

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these two RUN can be chained together.


Expand All @@ -125,9 +136,6 @@ RUN apk add --no-cache --update python3 \
py3-virtualenv \
python3-dev

# Remove build dependencies
RUN apk del build-dependencies

COPY config/php.ini /usr/local/etc/php/
COPY config/fpm.conf /usr/local/etc/php-fpm.d/zz-totara.conf

Expand Down
76 changes: 42 additions & 34 deletions php/php81/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,24 @@ RUN apk add --no-cache --update \
tzdata \
vim \
wget \
zip \
&& apk add --no-cache --virtual build-dependencies \
zip

RUN apk add --no-cache --update --virtual build-dependencies \
curl-dev \
freetype-dev \
freetds-dev \
libjpeg-turbo-dev \
libmcrypt-dev \
libmemcached-dev \
libpng-dev \
libpq-dev \
libxml2-dev \
libzip-dev \
icu-dev \
openldap-dev \
unixodbc-dev \
gcc \
make \
g++ \
&& docker-php-ext-install -j$(nproc) zip \
g++ && \
docker-php-ext-install -j$(nproc) zip \
intl \
soap \
opcache \
Expand All @@ -61,31 +60,36 @@ RUN apk add --no-cache --update \
mysqli \
exif \
ldap \
pdo_dblib \
&& docker-php-ext-configure gd \
pdo_dblib && \
docker-php-ext-configure gd \
--with-freetype \
--with-jpeg \
&& docker-php-ext-install -j$(nproc) gd
--with-jpeg && \
docker-php-ext-install -j$(nproc) gd && \
apk del build-dependencies

RUN git clone https://github.com/tideways/php-profiler-extension.git \
&& cd php-profiler-extension \
&& phpize \
&& ./configure \
&& make && make install
RUN apk add --no-cache --update --virtual build-dependencies \
gcc \
make \
g++ \
libmemcached-dev \
libzip-dev \
pkgconfig && \
git clone https://github.com/tideways/php-profiler-extension.git && \
cd php-profiler-extension && \
phpize && \
./configure && \
make && make install && \
pecl install -o -f redis && \
pecl install -o -f igbinary && \
pecl install -o -f memcached && \
rm -rf /tmp/pear && \
apk del build-dependencies

RUN echo "extension=tideways_xhprof.so" >> /usr/local/etc/php/conf.d/tideways_xhprof.ini

RUN pecl install -o -f redis \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable redis

RUN pecl install -o -f igbinary \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable igbinary

RUN pecl install -o -f memcached \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable memcached
RUN docker-php-ext-enable redis && \
docker-php-ext-enable igbinary && \
docker-php-ext-enable memcached

ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
Expand All @@ -107,12 +111,19 @@ RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --import - &&
RUN apk add --allow-untrusted msodbcsql18_18.3.1.1-1_$TARGETARCH.apk && \
apk add --allow-untrusted mssql-tools18_18.3.1.1-1_$TARGETARCH.apk

RUN echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bash_profile \
&& echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
RUN echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bash_profile && \
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc

RUN pear config-set php_ini `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` system \
&& pecl install sqlsrv \
&& pecl install pdo_sqlsrv
RUN apk add --no-cache --update --virtual build-dependencies \
gcc \
make \
g++ \
unixodbc-dev && \
pear config-set php_ini `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` system && \
pecl install sqlsrv && \
pecl install pdo_sqlsrv && \
rm -rf /tmp/pear && \
apk del build-dependencies

RUN docker-php-ext-enable sqlsrv.so && docker-php-ext-enable pdo_sqlsrv.so

Expand All @@ -125,9 +136,6 @@ RUN apk add --no-cache --update python3 \
py3-virtualenv \
python3-dev

# Remove build dependencies
RUN apk del build-dependencies

COPY config/php.ini /usr/local/etc/php/
COPY config/fpm.conf /usr/local/etc/php-fpm.d/zz-totara.conf

Expand Down