use Docker cache mount for Ruby bundler

This commit is contained in:
Ryan Cavicchioni 2025-05-05 22:47:24 -05:00
parent 2da770623f
commit 19d1e60d2f
Signed by: ryanc
SSH Key Fingerprint: SHA256:KbXiwUnZnHFwFtt3Bytd+F3FN9pPHn1Z1cxMIE1TPbg
2 changed files with 4 additions and 6 deletions

View File

@ -30,10 +30,9 @@ EOT
COPY Gemfile Gemfile.lock ./ COPY Gemfile Gemfile.lock ./
RUN <<EOT RUN \
--mount=type=cache,id=usr-local-bundle-ruby-cache,target=${BUNDLE_PATH}/ruby/3.4.0/cache,sharing=locked \
bundle install bundle install
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git
EOT
COPY . . COPY . .

View File

@ -38,10 +38,9 @@ RUN \
COPY Gemfile Gemfile.lock ./ COPY Gemfile Gemfile.lock ./
RUN <<EOT RUN \
--mount=type=cache,id=usr-local-bundle-ruby-cache,target=${BUNDLE_PATH}/ruby/3.4.0/cache,sharing=locked \
bundle install bundle install
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git
EOT
COPY . . COPY . .