Combine apt statements in Dockerfile
Quoting the Docker documentation [1]: > Always combine RUN apt-get update with apt-get install in the same RUN > statement. > (...) > Using apt-get update alone in a RUN statement causes caching issues > and subsequent apt-get install instructions fail. > (...) > Docker sees the initial and modified instructions as identical and > reuses the cache from previous steps. As a result the apt-get update > is not executed because the build uses the cached version. Because the > apt-get update is not run, your build can potentially get an outdated > version of the curl and nginx packages. > > Using RUN apt-get update && apt-get install -y ensures your Dockerfile > installs the latest package versions with no further coding or manual > intervention. [1] https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run
This commit is contained in:
@@ -3,8 +3,7 @@ FROM ruby:2.7.4-buster
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# Install essential Linux packages
|
||||
RUN apt-get update -qq
|
||||
RUN apt-get install -y build-essential libpq-dev postgresql-client nodejs imagemagick sudo libxss1 libappindicator1 libindicator7 unzip memcached cmake pkg-config shared-mime-info
|
||||
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev postgresql-client nodejs imagemagick sudo libxss1 libappindicator1 libindicator7 unzip memcached cmake pkg-config shared-mime-info
|
||||
# Install Chromium for E2E integration tests
|
||||
RUN apt-get update -qq && apt-get install -y chromium
|
||||
|
||||
|
||||
Reference in New Issue
Block a user