Compare commits
7 Commits
8e3e81978a
...
34e5e8dcf8
Author | SHA1 | Date | |
---|---|---|---|
34e5e8dcf8
|
|||
bdcd99ec92
|
|||
5fb1f2fcc7
|
|||
df808b8396
|
|||
6ec00632d1
|
|||
fafe0bc0bd
|
|||
533cea3b26
|
@@ -10,7 +10,6 @@ target "_common" {
|
|||||||
RUBY_VERSION = "3.4.4"
|
RUBY_VERSION = "3.4.4"
|
||||||
}
|
}
|
||||||
platforms = [
|
platforms = [
|
||||||
"linux/amd64",
|
|
||||||
"linux/arm64",
|
"linux/arm64",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,10 @@
|
|||||||
ARG RUBY_VERSION="3.4.4"
|
ARG RUBY_VERSION="3.4.4"
|
||||||
ARG BASE_REGISTRY="docker.io"
|
ARG BASE_REGISTRY="docker.io"
|
||||||
|
|
||||||
FROM ${BASE_REGISTRY}/ruby:${RUBY_VERSION}-alpine AS base
|
FROM ${BASE_REGISTRY}/ruby:${RUBY_VERSION}-alpine AS base
|
||||||
|
|
||||||
|
ARG TARGETARCH
|
||||||
|
|
||||||
ENV RACK_ENV="production" \
|
ENV RACK_ENV="production" \
|
||||||
BUNDLE_DEPLOYMENT=true \
|
BUNDLE_DEPLOYMENT=true \
|
||||||
BUNDLE_PATH="/usr/local/bundle" \
|
BUNDLE_PATH="/usr/local/bundle" \
|
||||||
@@ -11,19 +14,20 @@ ENV RACK_ENV="production" \
|
|||||||
WORKDIR /kubernaut
|
WORKDIR /kubernaut
|
||||||
|
|
||||||
RUN \
|
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 update -q; \
|
||||||
apk add bash jemalloc
|
apk add bash jemalloc
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
--mount=type=cache,id=usr-local-bundle-cache,target=${BUNDLE_PATH},sharing=locked \
|
--mount=type=cache,id=usr-local-bundle-cache-${TARGETARCH},target=${BUNDLE_PATH},sharing=locked \
|
||||||
gem update --system --no-document; \
|
|
||||||
gem install -N bundler
|
gem install -N bundler
|
||||||
|
|
||||||
FROM base AS build
|
FROM base AS build
|
||||||
|
|
||||||
|
ARG TARGETARCH
|
||||||
|
|
||||||
RUN \
|
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 update -q; \
|
||||||
apk add musl-dev gcc make; \
|
apk add musl-dev gcc make; \
|
||||||
apk add bash jemalloc
|
apk add bash jemalloc
|
||||||
@@ -31,7 +35,7 @@ RUN \
|
|||||||
COPY Gemfile Gemfile.lock ./
|
COPY Gemfile Gemfile.lock ./
|
||||||
|
|
||||||
RUN \
|
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
|
bundle install
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
@@ -1,8 +1,11 @@
|
|||||||
ARG RUBY_VERSION="3.4.4"
|
ARG RUBY_VERSION="3.4.4"
|
||||||
ARG BASE_REGISTRY="docker.io"
|
ARG BASE_REGISTRY="docker.io"
|
||||||
ARG DEBIAN_VERSION="bookworm"
|
ARG DEBIAN_VERSION="bookworm"
|
||||||
|
|
||||||
FROM ${BASE_REGISTRY}/ruby:${RUBY_VERSION}-slim-${DEBIAN_VERSION} AS base
|
FROM ${BASE_REGISTRY}/ruby:${RUBY_VERSION}-slim-${DEBIAN_VERSION} AS base
|
||||||
|
|
||||||
|
ARG TARGETARCH
|
||||||
|
|
||||||
ENV RACK_ENV="production" \
|
ENV RACK_ENV="production" \
|
||||||
BUNDLE_DEPLOYMENT=true \
|
BUNDLE_DEPLOYMENT=true \
|
||||||
BUNDLE_PATH="/usr/local/bundle" \
|
BUNDLE_PATH="/usr/local/bundle" \
|
||||||
@@ -14,24 +17,25 @@ WORKDIR /kubernaut
|
|||||||
RUN rm -f /etc/apt/apt.conf.d/docker-clean
|
RUN rm -f /etc/apt/apt.conf.d/docker-clean
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
--mount=type=cache,id=var-cache-apt,target=/var/cache/apt,sharing=locked \
|
--mount=type=cache,id=var-cache-apt-${TARGETARCH},target=/var/cache/apt,sharing=locked \
|
||||||
--mount=type=cache,id=var-lib-apt,target=/var/lib/apt,sharing=locked \
|
--mount=type=cache,id=var-lib-apt,target=/var/lib/apt,sharing=locked \
|
||||||
apt-get update -qq; \
|
apt-get update -qq; \
|
||||||
apt-get install --yes --no-install-recommends \
|
apt-get install --yes --no-install-recommends \
|
||||||
libjemalloc2
|
libjemalloc2
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
--mount=type=cache,id=usr-local-bundle-cache,target=${BUNDLE_PATH},sharing=locked \
|
--mount=type=cache,id=usr-local-bundle-cache-${TARGETARCH},target=${BUNDLE_PATH},sharing=locked \
|
||||||
gem update --system --no-document; \
|
|
||||||
gem install -N bundler
|
gem install -N bundler
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND="noninteractive"
|
ENV DEBIAN_FRONTEND="noninteractive"
|
||||||
|
|
||||||
FROM base AS build
|
FROM base AS build
|
||||||
|
|
||||||
|
ARG TARGETARCH
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
--mount=type=cache,id=var-cache-apt,target=/var/cache/apt,sharing=locked \
|
--mount=type=cache,id=var-cache-apt-${TARGETARCH},target=/var/cache/apt,sharing=locked \
|
||||||
--mount=type=cache,id=var-lib-apt,target=/var/lib/apt,sharing=locked \
|
--mount=type=cache,id=var-lib-apt-${TARGETARCH},target=/var/lib/apt,sharing=locked \
|
||||||
apt-get update -qq; \
|
apt-get update -qq; \
|
||||||
apt-get install --yes --no-install-recommends \
|
apt-get install --yes --no-install-recommends \
|
||||||
build-essential
|
build-essential
|
||||||
@@ -39,7 +43,7 @@ RUN \
|
|||||||
COPY Gemfile Gemfile.lock ./
|
COPY Gemfile Gemfile.lock ./
|
||||||
|
|
||||||
RUN \
|
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
|
bundle install
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
Reference in New Issue
Block a user