Dockerfile 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. # 1) use alpine to generate a void environment
  2. FROM alpine:3.9 as stage0
  3. ARG REPOSITORY=https://alpha.de.repo.voidlinux.org/current
  4. ARG ARCH=x86_64
  5. COPY keys/* /target/var/db/xbps/keys/
  6. RUN apk add ca-certificates && \
  7. wget -O - https://alpha.de.repo.voidlinux.org/static/xbps-static-latest.$(uname -m)-musl.tar.xz | \
  8. tar Jx && \
  9. XBPS_ARCH=${ARCH} xbps-install.static -yMU \
  10. --repository=${REPOSITORY} \
  11. --repository=${REPOSITORY}/musl \
  12. -r /target \
  13. base-minimal
  14. # 2) using void to generate the final build
  15. FROM scratch as stage1
  16. ARG REPOSITORY=https://alpha.de.repo.voidlinux.org/current
  17. ARG ARCH=x86_64
  18. COPY --from=stage0 /target /
  19. COPY keys/* /target/var/db/xbps/keys/
  20. RUN xbps-reconfigure -a && \
  21. mkdir -p /target/var/cache && ln -s /var/cache/xbps /target/var/cache/xbps && \
  22. XBPS_ARCH=${ARCH} xbps-install -yMU \
  23. --repository=${REPOSITORY} \
  24. --repository=${REPOSITORY}/musl \
  25. -r /target \
  26. base-minimal
  27. # 3) configure and clean up the final image
  28. FROM scratch
  29. COPY --from=stage1 /target /
  30. RUN xbps-reconfigure -a && \
  31. rm -r /var/cache/xbps