From d94c4836e7f6d426729af0d62993d1059eac6b1d Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Wed, 22 Jan 2020 20:32:19 +0100 Subject: [PATCH] optimize apt-get step (#18) 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. --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8762001..c7712c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ LABEL maintainer="Andy Miller (@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 \ @@ -18,6 +18,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