-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reduce amount and size of Docker image layers
- Loading branch information
Michał Markiewicz
committed
Nov 18, 2021
1 parent
a8236d7
commit 9c754d2
Showing
1 changed file
with
19 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,27 @@ | ||
ARG PHP_BASE_IMAGE_TAG=8.0-fpm | ||
|
||
FROM php:${PHP_BASE_IMAGE_TAG} AS sylius_php | ||
RUN apt update | ||
RUN apt install -y zlib1g-dev | ||
RUN apt install -y libpng-dev | ||
RUN apt install -y libjpeg-dev | ||
RUN apt install -y libfreetype6-dev | ||
RUN apt install -y libicu-dev | ||
RUN apt install -y zip | ||
RUN apt install -y libmemcached-dev | ||
RUN docker-php-ext-install gd | ||
RUN docker-php-ext-install exif | ||
RUN docker-php-ext-install fileinfo | ||
RUN docker-php-ext-install intl | ||
RUN docker-php-ext-install pdo_mysql | ||
RUN docker-php-ext-install opcache | ||
RUN pecl install apcu | ||
|
||
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y unzip && \ | ||
install-php-extensions \ | ||
apcu \ | ||
exif \ | ||
fileinfo \ | ||
gd \ | ||
imagick \ | ||
intl \ | ||
memcached \ | ||
opcache \ | ||
pdo_mysql \ | ||
zip | ||
RUN docker-php-ext-enable apcu --ini-name 10-docker-php-ext-apcu.ini | ||
RUN pecl install memcached | ||
RUN docker-php-ext-enable memcached | ||
RUN docker-php-ext-configure gd --with-freetype --with-jpeg | ||
RUN apt install -y libmagickwand-dev --no-install-recommends | ||
RUN pecl install imagick | ||
RUN docker-php-ext-enable imagick | ||
ENV PHP_DATE_TIMEZONE="Europe/Warsaw" | ||
COPY --from=composer /usr/bin/composer /usr/bin/composer | ||
WORKDIR /symfony | ||
RUN apt install -y wget | ||
RUN wget https://get.symfony.com/cli/installer | ||
RUN chmod +x installer | ||
RUN bash installer | ||
RUN mv /root/.symfony/bin/symfony /usr/local/bin/symfony | ||
|
||
RUN curl -fs https://get.symfony.com/cli/installer | bash && \ | ||
mv /root/.symfony/bin/symfony /usr/local/bin/symfony | ||
WORKDIR / |