2019-03-08 10:02:08 +01:00
|
|
|
# 1) use alpine to generate a void environment
|
2020-06-07 17:52:59 -07:00
|
|
|
FROM alpine:3.12 as stage0
|
2019-03-24 20:42:51 -07:00
|
|
|
ARG REPOSITORY=https://alpha.de.repo.voidlinux.org
|
2019-03-08 10:02:08 +01:00
|
|
|
ARG ARCH=x86_64
|
|
|
|
COPY keys/* /target/var/db/xbps/keys/
|
2019-10-23 10:39:17 -05:00
|
|
|
RUN apk add ca-certificates curl && \
|
|
|
|
curl ${REPOSITORY}/static/xbps-static-latest.$(uname -m)-musl.tar.xz | \
|
2019-03-08 10:02:08 +01:00
|
|
|
tar Jx && \
|
|
|
|
XBPS_ARCH=${ARCH} xbps-install.static -yMU \
|
2019-03-24 20:42:51 -07:00
|
|
|
--repository=${REPOSITORY}/current \
|
|
|
|
--repository=${REPOSITORY}/current/musl \
|
2019-03-08 10:02:08 +01:00
|
|
|
-r /target \
|
|
|
|
base-minimal
|
|
|
|
|
|
|
|
# 2) using void to generate the final build
|
|
|
|
FROM scratch as stage1
|
2019-03-24 20:42:51 -07:00
|
|
|
ARG REPOSITORY=https://alpha.de.repo.voidlinux.org
|
2019-03-08 10:02:08 +01:00
|
|
|
ARG ARCH=x86_64
|
2019-03-24 20:42:51 -07:00
|
|
|
ARG BASEPKG=base-minimal
|
2019-03-08 10:02:08 +01:00
|
|
|
COPY --from=stage0 /target /
|
|
|
|
COPY keys/* /target/var/db/xbps/keys/
|
|
|
|
RUN xbps-reconfigure -a && \
|
|
|
|
mkdir -p /target/var/cache && ln -s /var/cache/xbps /target/var/cache/xbps && \
|
|
|
|
XBPS_ARCH=${ARCH} xbps-install -yMU \
|
2019-03-24 20:42:51 -07:00
|
|
|
--repository=${REPOSITORY}/current \
|
|
|
|
--repository=${REPOSITORY}/current/musl \
|
2019-03-08 10:02:08 +01:00
|
|
|
-r /target \
|
2020-05-08 22:17:26 +02:00
|
|
|
${BASEPKG}
|
2019-03-08 10:02:08 +01:00
|
|
|
|
|
|
|
# 3) configure and clean up the final image
|
|
|
|
FROM scratch
|
|
|
|
COPY --from=stage1 /target /
|
|
|
|
RUN xbps-reconfigure -a && \
|
|
|
|
rm -r /var/cache/xbps
|
2019-09-13 12:44:27 +03:00
|
|
|
|
|
|
|
CMD ["/bin/sh"]
|