namespace cache IDs by TARGETARCH
Some checks failed
Ruby Lint / lint (push) Successful in 16s
Ruby Test / test (push) Has been cancelled
Release / docker (push) Has been cancelled

This commit is contained in:
2025-06-28 14:03:55 -05:00
parent 653167adb5
commit 54dcec73f6
2 changed files with 13 additions and 9 deletions

View File

@ -1,5 +1,7 @@
ARG RUBY_VERSION="3.4.4"
ARG BASE_REGISTRY="docker.io"
ARG TARGETARCH
FROM ${BASE_REGISTRY}/ruby:${RUBY_VERSION}-alpine AS base
ENV RACK_ENV="production" \
@ -11,7 +13,7 @@ ENV RACK_ENV="production" \
WORKDIR /kubernaut
RUN \
--mount=type=cache,id=var-cache-apk,target=/var/cache/apk,sharing=locked \
--mount=type=cache,id=var-cache-apk-${TARGETARCH},target=/var/cache/apk,sharing=locked \
apk update -q; \
apk add bash jemalloc
@ -23,7 +25,7 @@ RUN \
FROM base AS build
RUN \
--mount=type=cache,id=var-cache-apk,target=/var/cache/apk,sharing=locked \
--mount=type=cache,id=var-cache-apk-${TARGETARCH},target=/var/cache/apk,sharing=locked \
apk update -q; \
apk add musl-dev gcc make; \
apk add bash jemalloc
@ -31,7 +33,7 @@ RUN \
COPY Gemfile Gemfile.lock ./
RUN \
--mount=type=cache,id=usr-local-bundle-ruby-cache,target=${BUNDLE_PATH}/ruby/3.4.0/cache,sharing=locked \
--mount=type=cache,id=usr-local-bundle-ruby-cache-${TARGETARCH},target=${BUNDLE_PATH}/ruby/3.4.0/cache,sharing=locked \
bundle install
COPY . .