namespace cache IDs by TARGETARCH
This commit is contained in:
@ -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 . .
|
||||
|
Reference in New Issue
Block a user