Skip to content

Commit 77854fe

Browse files
classabbyampDuncaen
andcommitted
Revamp build process
Co-authored-by: Duncan Overbruck <[email protected]>
1 parent df045c1 commit 77854fe

17 files changed

+309
-421
lines changed

.github/workflows/bootstrap.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

.github/workflows/build.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
name: 'Build containers'
3+
4+
on:
5+
workflow_dispatch:
6+
push:
7+
paths-ignore:
8+
- COPYING
9+
- README.md
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
outputs:
19+
metadata: ${{ steps.build_and_push.outputs.metadata }}
20+
steps:
21+
- name: Checkout
22+
uses: classabbyamp/treeless-checkout-action@v1
23+
24+
- name: Docker metadata
25+
id: meta
26+
uses: docker/metadata-action@v4
27+
with:
28+
images: |
29+
ghcr.io/${{ github.repository_owner }}/void-glibc
30+
ghcr.io/${{ github.repository_owner }}/void-glibc-full
31+
ghcr.io/${{ github.repository_owner }}/void-glibc-busybox
32+
ghcr.io/${{ github.repository_owner }}/void-musl
33+
ghcr.io/${{ github.repository_owner }}/void-musl-full
34+
ghcr.io/${{ github.repository_owner }}/void-musl-busybox
35+
tags: |
36+
type=sha,prefix=
37+
type=raw,value=latest,enable={{is_default_branch}}
38+
type=raw,value={{date 'YYYYMMDD'}},enable={{is_default_branch}},priority=1000
39+
flavor: latest=false
40+
labels: |
41+
org.opencontainers.image.authors=Void Linux team and contributors
42+
org.opencontainers.image.url=https://voidlinux.org
43+
org.opencontainers.image.documentation=https://docs.voidlinux.org
44+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
45+
org.opencontainers.image.vendor=Void Linux
46+
org.opencontainers.image.title=Void Linux
47+
org.opencontainers.image.description=general-purpose image based on Void Linux
48+
49+
- name: Set up QEMU
50+
uses: docker/setup-qemu-action@v2
51+
52+
- name: Set up Docker Buildx
53+
uses: docker/setup-buildx-action@v2
54+
55+
- name: Login to GCHR
56+
uses: docker/login-action@v2
57+
with:
58+
registry: ghcr.io
59+
username: ${{ github.actor }}
60+
password: ${{ secrets.GITHUB_TOKEN }}
61+
62+
- name: Build and push images
63+
id: build_and_push
64+
uses: docker/bake-action@v3
65+
with:
66+
push: ${{ endsWith(github.ref, 'master') }}
67+
files: |
68+
docker-bake.hcl
69+
${{ steps.meta.outputs.bake-file }}
70+
set: |
71+
_common.cache-to=type=gha
72+
_common.cache-from=type=gha

.github/workflows/containers.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

.github/workflows/masterdirs.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

COPYING

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Copyright (c) 2008-2020 Juan Romero Pardines and contributors
2-
Copyright (c) 2017-2021 The Void Linux team and contributors
2+
Copyright (c) 2017-2023 The Void Linux team and contributors
33
All rights reserved.
44

55
Redistribution and use in source and binary forms, with or without

Containerfile

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# syntax=docker/dockerfile:1
2+
FROM --platform=${BUILDPLATFORM} alpine:3.18 AS bootstrap
3+
ARG TARGETPLATFORM
4+
ARG MIRROR=https://repo-ci.voidlinux.org
5+
ARG LIBC
6+
RUN apk add ca-certificates curl && \
7+
curl "${MIRROR}/static/xbps-static-static-0.59_5.$(uname -m)-musl.tar.xz" | tar vJx
8+
COPY keys/* /target/var/db/xbps/keys/
9+
COPY setup.sh /bootstrap/setup.sh
10+
RUN --mount=type=cache,sharing=locked,target=/target/var/cache/xbps,id=repocache-${LIBC} \
11+
. /bootstrap/setup.sh; \
12+
XBPS_TARGET_ARCH=${ARCH} xbps-install -S \
13+
-R "${REPO}" \
14+
-r /target
15+
16+
FROM --platform=${BUILDPLATFORM} bootstrap AS install-default
17+
ARG TARGETPLATFORM
18+
ARG MIRROR
19+
ARG LIBC
20+
COPY --from=bootstrap /target /target
21+
COPY noextract.conf /target/etc/xbps.d/noextract.conf
22+
RUN --mount=type=cache,sharing=locked,target=/target/var/cache/xbps,id=repocache-${LIBC} \
23+
. /bootstrap/setup.sh; \
24+
XBPS_TARGET_ARCH=${ARCH} xbps-install -y \
25+
-R "${REPO}" \
26+
-r /target \
27+
xbps base-files dash coreutils grep run-parts sed gawk
28+
29+
FROM --platform=${BUILDPLATFORM} bootstrap AS install-busybox
30+
ARG TARGETPLATFORM
31+
ARG MIRROR
32+
ARG LIBC
33+
COPY --from=bootstrap /target /target
34+
COPY noextract.conf /target/etc/xbps.d/noextract.conf
35+
RUN --mount=type=cache,sharing=locked,target=/target/var/cache/xbps,id=repocache-${LIBC} \
36+
. /bootstrap/setup.sh; \
37+
XBPS_TARGET_ARCH=${ARCH} xbps-install -y \
38+
-R "${REPO}" \
39+
-r /target \
40+
xbps base-files busybox-huge
41+
42+
FROM --platform=${BUILDPLATFORM} bootstrap AS install-full
43+
ARG TARGETPLATFORM
44+
ARG MIRROR
45+
ARG LIBC
46+
COPY --from=bootstrap /target /target
47+
RUN --mount=type=cache,sharing=locked,target=/target/var/cache/xbps,id=repocache-${LIBC} \
48+
. /bootstrap/setup.sh; \
49+
XBPS_TARGET_ARCH=${ARCH} xbps-install -y \
50+
-R "${REPO}" \
51+
-r /target \
52+
base-minimal
53+
54+
FROM scratch AS image-default
55+
COPY --link --from=install-default /target /
56+
RUN --mount=type=tmpfs,target=/tmp \
57+
xbps-reconfigure -a; \
58+
rm -rf /var/cache/xbps/*
59+
CMD ["/bin/sh"]
60+
61+
FROM scratch AS image-busybox
62+
COPY --link --from=install-busybox /target /
63+
RUN --mount=type=tmpfs,target=/tmp \
64+
for util in $(/usr/bin/busybox --list); do \
65+
[ ! -f "/usr/bin/$util" ] && /usr/bin/busybox ln -sfv busybox "/usr/bin/$util"; \
66+
done; \
67+
xbps-reconfigure -a; \
68+
rm -rf /var/cache/xbps/*
69+
CMD ["/bin/sh"]
70+
71+
FROM scratch AS image-full
72+
COPY --link --from=install-full /target /
73+
RUN --mount=type=tmpfs,target=/tmp \
74+
xbps-reconfigure -a; \
75+
rm -rf /var/cache/xbps/*
76+
CMD ["/bin/sh"]

Dockerfile.bootstrap

Lines changed: 0 additions & 29 deletions
This file was deleted.

Dockerfile.full

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)