use Docker cache mount for Ruby gems

This commit is contained in:
Ryan Cavicchioni 2025-05-05 22:46:42 -05:00
parent e90966970a
commit 2da770623f
Signed by: ryanc
SSH Key Fingerprint: SHA256:KbXiwUnZnHFwFtt3Bytd+F3FN9pPHn1Z1cxMIE1TPbg
2 changed files with 7 additions and 6 deletions

View File

@ -14,10 +14,12 @@ RUN <<EOT
apk update -q apk update -q
apk add bash jemalloc apk add bash jemalloc
rm -rf /var/cache/apk rm -rf /var/cache/apk
gem update --system --no-document
gem install -N bundler
EOT EOT
RUN \
--mount=type=cache,id=usr-local-bundle-cache,target=${BUNDLE_PATH},sharing=locked \
gem update --system --no-document; \
gem install -N bundler
FROM base AS build FROM base AS build

View File

@ -20,11 +20,10 @@ RUN \
apt-get install --yes --no-install-recommends \ apt-get install --yes --no-install-recommends \
libjemalloc2 libjemalloc2
RUN <<EOT RUN \
gem update --system --no-document --mount=type=cache,id=usr-local-bundle-cache,target=${BUNDLE_PATH},sharing=locked \
gem update --system --no-document; \
gem install -N bundler gem install -N bundler
EOT
ENV DEBIAN_FRONTEND="noninteractive" ENV DEBIAN_FRONTEND="noninteractive"