Skip to content

Commit

Permalink
build: restore cache volume
Browse files Browse the repository at this point in the history
This arranges for the cache volume to be created first, as a separate
layer that depends on the same variables and is therefore specific to
each package build.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
  • Loading branch information
bcressey committed Sep 15, 2019
1 parent 5708e31 commit f5c863c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ RUN dnf -y groupinstall "C Development Tools and Libraries" \
FROM origin AS util
RUN dnf -y install createrepo_c e2fsprogs gdisk grub2-tools kpartx lz4 veritysetup dosfstools mtools

FROM scratch AS cache
ARG PACKAGE
ARG ARCH
COPY .dockerignore .${PACKAGE}.${ARCH}

FROM base AS rpmbuild
ARG PACKAGE
ARG ARCH
Expand Down Expand Up @@ -50,6 +55,7 @@ RUN --mount=target=/host \

USER builder
RUN --mount=source=.cargo,target=/home/builder/.cargo \
--mount=type=cache,target=/home/builder/.cache,uid=1000,from=cache \
--mount=source=workspaces,target=/home/builder/rpmbuild/BUILD/workspaces \
rpmbuild -ba --clean rpmbuild/SPECS/${PACKAGE}.spec

Expand Down

0 comments on commit f5c863c

Please sign in to comment.