Skip to content

Commit

Permalink
Make apk cache
Browse files Browse the repository at this point in the history
  • Loading branch information
sinoru committed Feb 27, 2024
1 parent 5152c86 commit bbd2ead
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
FROM alpine AS base
ARG TARGETPLATFORM

RUN \
--mount=type=cache,target=/var/cache,sharing=locked \
--mount=type=cache,id=$TARGETPLATFORM:/var/cache/apk,target=/var/cache/apk,sharing=locked \
--mount=type=cache,target=$TARGETPLATFORM:/var/cache,sharing=locked \
--mount=type=tmpfs,target=/var/log \
set -eux; \
apk add --no-cache \
apk adduser \
ca-certificates \
c-ares \
libevent \
Expand All @@ -15,12 +17,14 @@ RUN \
################################################################################

FROM base AS builder-base
ARG TARGETPLATFORM

RUN \
--mount=type=cache,target=/var/cache,sharing=locked \
--mount=type=cache,id=$TARGETPLATFORM:/var/cache/apk,target=/var/cache/apk,sharing=locked \
--mount=type=cache,target=$TARGETPLATFORM:/var/cache,sharing=locked \
--mount=type=tmpfs,target=/var/log \
set -eux; \
apk add --no-cache \
apk add \
autoconf \
automake \
build-base \
Expand Down Expand Up @@ -99,12 +103,14 @@ RUN set -eux; \
################################################################################

FROM base
ARG TARGETPLATFORM

RUN \
--mount=type=cache,target=/var/cache,sharing=locked \
--mount=type=cache,id=$TARGETPLATFORM:/var/cache/apk,target=/var/cache/apk,sharing=locked \
--mount=type=cache,target=$TARGETPLATFORM:/var/cache,sharing=locked \
--mount=type=tmpfs,target=/var/log \
set -eux; \
apk add --no-cache \
apk add \
tini \
;

Expand Down

0 comments on commit bbd2ead

Please sign in to comment.