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
|
||||
|
||||
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
|
||||
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 install -N bundler
|
||||
EOT
|
||||
@ -23,11 +29,12 @@ ENV DEBIAN_FRONTEND="noninteractive"
|
||||
|
||||
FROM base AS build
|
||||
|
||||
RUN <<EOT
|
||||
apt-get update -qq
|
||||
apt-get install --yes --no-install-recommends gcc make libc-dev
|
||||
rm -rf /var/lib/apt/lists /var/cache/apt/archives
|
||||
EOT
|
||||
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 \
|
||||
build-essential
|
||||
|
||||
COPY Gemfile Gemfile.lock ./
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user