diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7406e03..8d281c6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -21,9 +21,47 @@ jobs: password: ${{ secrets.CR_PAT }} - name: Set version run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 + - name: Docker metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: | + ghcr.io/${{ github.repository_owner }}/void-updates + tags: | + type=sha,prefix= + type=raw,value=latest + type=raw,value=${{env.RELEASE_VERSION}},priority=1000 + flavor: latest=false + labels: | + org.opencontainers.image.authors=Void Linux team and contributors + org.opencontainers.image.url=https://voidlinux.org + org.opencontainers.image.source=https://github.com/${{ github.repository }} + org.opencontainers.image.vendor=Void Linux + org.opencontainers.image.title=void-updates + org.opencontainers.image.description=Update check system for void-packages + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to GCHR + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push images + id: build_and_push + uses: docker/bake-action@v3 with: push: true - tags: "ghcr.io/${{ github.repository }}:${{ env.RELEASE_VERSION }}" + targets: void-updates + files: | + services/pkg/docker-bake.hcl + ${{ steps.meta.outputs.bake-file }} + set: | + _common.cache-to=type=gha + _common.cache-from=type=gha diff --git a/Dockerfile b/Dockerfile index 19b7123..e9f028f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -ARG BASE=ghcr.io/void-linux/void-linux:20220530RC01-full-x86_64-musl +ARG BASE=ghcr.io/void-linux/void-musl-full:20231003R1 FROM ${BASE} -RUN xbps-install -yMu xbps && xbps-install -yMU git bash curl util-linux findutils +RUN xbps-install -yMu xbps && xbps-install -yMu git bash curl util-linux findutils COPY void-updates.sh /usr/local/bin/void-updates COPY entrypoint.sh /entrypoint diff --git a/docker-bake.hcl b/docker-bake.hcl new file mode 100644 index 0000000..345f0ea --- /dev/null +++ b/docker-bake.hcl @@ -0,0 +1,15 @@ +target "docker-metadata-action" {} + +target "_common" { + inherits = ["docker-metadata-action"] + dockerfile = "Dockerfile" + cache-to = ["type=local,dest=/tmp/buildx-cache"] + cache-from = ["type=local,src=/tmp/buildx-cache"] +} + +target "void-updates" { + inherits = ["_common"] + platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7", "linux/arm/v6"] + args = { "LIBC" = "musl" } +} +