optimize apt-get step

source: https://www.fromlatest.io/#/

Line 8: Consider `--no-install-recommends` (Optimization)
Consider using a --no-install-recommends when apt-get installing packages. This will result in a smaller image size.

Line 8: apt-get update with matching cache rm (Optimization)
Use of apt-get update should be paired with rm -rf /var/lib/apt/lists/* in the same layer.
This commit is contained in:
Rotzbua 2019-11-03 20:42:15 +01:00 committed by GitHub
parent c5ee3da9aa
commit d0411e94bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -5,7 +5,7 @@ LABEL maintainer="Andy Miller <rhuk@getgrav.org> (@rhukster)"
RUN a2enmod rewrite expires
# Install dependencies
RUN apt-get update && apt-get install -y \
RUN apt-get update && apt-get install -y --no-install-recommends \
unzip \
libfreetype6-dev \
libjpeg62-turbo-dev \
@ -15,6 +15,7 @@ RUN apt-get update && apt-get install -y \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install zip
&& rm -rf /var/lib/apt/lists/*
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php