From 51ab69a2cf41627068aa0067390623d5c0625232 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Mon, 11 Aug 2025 14:00:00 -0400 Subject: [PATCH] Dockerfile: Use a cache mount for bundled gems ref: https://fizzy.37signals.com/5986089/collections/7/cards/1338 --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0faa475f7..996e9aa4b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,9 +24,8 @@ RUN apt-get update -qq && \ # Install application gems COPY Gemfile Gemfile.lock .ruby-version ./ -RUN --mount=type=secret,id=GITHUB_TOKEN \ - gem install bundler &&\ - BUNDLE_GITHUB__COM="$(cat /run/secrets/GITHUB_TOKEN):x-oauth-basic" bundle install && \ +RUN --mount=type=secret,id=GITHUB_TOKEN --mount=type=cache,id=fizzy-permabundle-${RUBY_VERSION},sharing=locked,target=/permabundle \ + BUNDLE_PATH=/permabundle BUNDLE_GITHUB__COM="$(cat /run/secrets/GITHUB_TOKEN):x-oauth-basic" bundle install && \ rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \ bundle exec bootsnap precompile --gemfile