void-mklive/Dockerfile

37 lines
1.1 KiB
Docker
Raw Normal View History

# 1) use alpine to generate a void environment
FROM alpine:3.9 as stage0
2019-03-24 20:42:51 -07:00
ARG REPOSITORY=https://alpha.de.repo.voidlinux.org
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 | \
tar Jx && \
XBPS_ARCH=${ARCH} xbps-install.static -yMU \
2019-03-24 20:42:51 -07:00
--repository=${REPOSITORY}/current \
--repository=${REPOSITORY}/current/musl \
-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
ARG ARCH=x86_64
2019-03-24 20:42:51 -07:00
ARG BASEPKG=base-minimal
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 \
-r /target \
${BASEPKG}
# 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"]