use Docker cache mount for apt
This commit is contained in:
parent
a719e5f820
commit
a54a46b0a6
@ -5,10 +5,16 @@ FROM ${BASE_REGISTRY}/ruby:${RUBY_VERSION}-slim-${DEBIAN_VERSION} AS base
|
|||||||
|
|
||||||
WORKDIR /kubernaut
|
WORKDIR /kubernaut
|
||||||
|
|
||||||
|
RUN rm -f /etc/apt/apt.conf.d/docker-clean
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
--mount=type=cache,id=var-cache-apt,target=/var/cache/apt,sharing=locked \
|
||||||
|
--mount=type=cache,id=var-lib-apt,target=/var/lib/apt,sharing=locked \
|
||||||
|
apt-get update -qq; \
|
||||||
|
apt-get install --yes --no-install-recommends \
|
||||||
|
libjemalloc2
|
||||||
|
|
||||||
RUN <<EOT
|
RUN <<EOT
|
||||||
apt-get update -qq
|
|
||||||
apt-get install --yes --no-install-recommends libjemalloc2
|
|
||||||
rm -rf /var/lib/apt/lists /var/cache/apt/archives
|
|
||||||
gem update --system --no-document
|
gem update --system --no-document
|
||||||
gem install -N bundler
|
gem install -N bundler
|
||||||
EOT
|
EOT
|
||||||
@ -23,11 +29,12 @@ ENV DEBIAN_FRONTEND="noninteractive"
|
|||||||
|
|
||||||
FROM base AS build
|
FROM base AS build
|
||||||
|
|
||||||
RUN <<EOT
|
RUN \
|
||||||
apt-get update -qq
|
--mount=type=cache,id=var-cache-apt,target=/var/cache/apt,sharing=locked \
|
||||||
apt-get install --yes --no-install-recommends gcc make libc-dev
|
--mount=type=cache,id=var-lib-apt,target=/var/lib/apt,sharing=locked \
|
||||||
rm -rf /var/lib/apt/lists /var/cache/apt/archives
|
apt-get update -qq; \
|
||||||
EOT
|
apt-get install --yes --no-install-recommends \
|
||||||
|
build-essential
|
||||||
|
|
||||||
COPY Gemfile Gemfile.lock ./
|
COPY Gemfile Gemfile.lock ./
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user