From e90a4da10ecf4e2b6a369f31115a4ed8a00f4c66 Mon Sep 17 00:00:00 2001 From: Ryan W Date: Sat, 6 May 2023 10:55:42 -0700 Subject: [PATCH] Experiment with mount cache --- Dockerfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 99caf65..1e4fc65 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,13 @@ ARG RUBY_VERSION=3.2.2 FROM ruby:${RUBY_VERSION}-slim # OS Level Dependencies -RUN apt-get update -qq && apt-get install -yq --no-install-recommends \ +RUN --mount=type=cache,target=/var/cache/apt \ + --mount=type=cache,target=/var/lib/apt,sharing=locked \ + --mount=type=tmpfs,target=/var/log \ + rm -f /etc/apt/apt.conf.d/docker-clean; \ + echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache; \ + apt-get update -qq \ + && apt-get install -yq --no-install-recommends \ build-essential \ gnupg2 \ less \ @@ -13,8 +19,7 @@ RUN apt-get update -qq && apt-get install -yq --no-install-recommends \ libpq-dev \ postgresql-client \ libvips \ - curl \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + curl ENV LANG=C.UTF-8 \ BUNDLE_JOBS=4 \