From e50c9e666b57c800361d5eb5c7023a0e64891d7d Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Sat, 5 Oct 2024 05:45:16 +0000 Subject: [PATCH] Enhancement: Add `libvirt-9` and `libvirt-10` variants --- .github/workflows/ci-master-pr.yml | 268 ++++++++++++++++++ README.md | 4 + generate/definitions/VARIANTS.ps1 | 10 + variants/2.7.0-libvirt-10/Dockerfile | 28 ++ .../2.7.0-libvirt-10/docker-entrypoint.sh | 8 + variants/2.7.0-libvirt-9/Dockerfile | 28 ++ variants/2.7.0-libvirt-9/docker-entrypoint.sh | 8 + variants/2.8.1-libvirt-10/Dockerfile | 28 ++ .../2.8.1-libvirt-10/docker-entrypoint.sh | 8 + variants/2.8.1-libvirt-9/Dockerfile | 28 ++ variants/2.8.1-libvirt-9/docker-entrypoint.sh | 8 + 11 files changed, 426 insertions(+) create mode 100644 variants/2.7.0-libvirt-10/Dockerfile create mode 100644 variants/2.7.0-libvirt-10/docker-entrypoint.sh create mode 100644 variants/2.7.0-libvirt-9/Dockerfile create mode 100644 variants/2.7.0-libvirt-9/docker-entrypoint.sh create mode 100644 variants/2.8.1-libvirt-10/Dockerfile create mode 100644 variants/2.8.1-libvirt-10/docker-entrypoint.sh create mode 100644 variants/2.8.1-libvirt-9/Dockerfile create mode 100644 variants/2.8.1-libvirt-9/docker-entrypoint.sh diff --git a/.github/workflows/ci-master-pr.yml b/.github/workflows/ci-master-pr.yml index 6c7f710..01afdf1 100644 --- a/.github/workflows/ci-master-pr.yml +++ b/.github/workflows/ci-master-pr.yml @@ -145,6 +145,140 @@ jobs: cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + # This step generates the docker tags + - name: Prepare + id: prep-2-8-1-libvirt-10 + run: | + set -e + + # Get ref, i.e. from refs/heads/, or from refs/tags/. E.g. 'master' or 'v0.0.0' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + + # Get short commit hash E.g. 'abc0123' + SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # Generate docker image tags + # E.g. 'v0.0.0-' and 'v0.0.0-abc0123-' + # E.g. 'master-' and 'master-abc0123-' + VARIANT="2.8.1-libvirt-10" + REF_VARIANT="${REF}-${VARIANT}" + REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}" + + # Pass variables to next step + echo "VARIANT_BUILD_DIR=$VARIANT_BUILD_DIR" >> $GITHUB_OUTPUT + echo "VARIANT=$VARIANT" >> $GITHUB_OUTPUT + echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT + echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT + + - name: 2.8.1-libvirt-10 - Build (PRs) + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v5 + with: + context: variants/2.8.1-libvirt-10 + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + push: false + tags: | + ${{ github.repository }}:${{ steps.prep-2-8-1-libvirt-10.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-2-8-1-libvirt-10.outputs.REF_SHA_VARIANT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + - name: 2.8.1-libvirt-10 - Build and push (master) + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v5 + with: + context: variants/2.8.1-libvirt-10 + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + push: true + tags: | + ${{ github.repository }}:${{ steps.prep-2-8-1-libvirt-10.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-2-8-1-libvirt-10.outputs.REF_SHA_VARIANT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + - name: 2.8.1-libvirt-10 - Build and push (release) + if: startsWith(github.ref, 'refs/tags/') + uses: docker/build-push-action@v5 + with: + context: variants/2.8.1-libvirt-10 + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + push: true + tags: | + ${{ github.repository }}:${{ steps.prep-2-8-1-libvirt-10.outputs.VARIANT }} + ${{ github.repository }}:${{ steps.prep-2-8-1-libvirt-10.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-2-8-1-libvirt-10.outputs.REF_SHA_VARIANT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # This step generates the docker tags + - name: Prepare + id: prep-2-8-1-libvirt-9 + run: | + set -e + + # Get ref, i.e. from refs/heads/, or from refs/tags/. E.g. 'master' or 'v0.0.0' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + + # Get short commit hash E.g. 'abc0123' + SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # Generate docker image tags + # E.g. 'v0.0.0-' and 'v0.0.0-abc0123-' + # E.g. 'master-' and 'master-abc0123-' + VARIANT="2.8.1-libvirt-9" + REF_VARIANT="${REF}-${VARIANT}" + REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}" + + # Pass variables to next step + echo "VARIANT_BUILD_DIR=$VARIANT_BUILD_DIR" >> $GITHUB_OUTPUT + echo "VARIANT=$VARIANT" >> $GITHUB_OUTPUT + echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT + echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT + + - name: 2.8.1-libvirt-9 - Build (PRs) + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v5 + with: + context: variants/2.8.1-libvirt-9 + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + push: false + tags: | + ${{ github.repository }}:${{ steps.prep-2-8-1-libvirt-9.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-2-8-1-libvirt-9.outputs.REF_SHA_VARIANT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + - name: 2.8.1-libvirt-9 - Build and push (master) + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v5 + with: + context: variants/2.8.1-libvirt-9 + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + push: true + tags: | + ${{ github.repository }}:${{ steps.prep-2-8-1-libvirt-9.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-2-8-1-libvirt-9.outputs.REF_SHA_VARIANT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + - name: 2.8.1-libvirt-9 - Build and push (release) + if: startsWith(github.ref, 'refs/tags/') + uses: docker/build-push-action@v5 + with: + context: variants/2.8.1-libvirt-9 + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + push: true + tags: | + ${{ github.repository }}:${{ steps.prep-2-8-1-libvirt-9.outputs.VARIANT }} + ${{ github.repository }}:${{ steps.prep-2-8-1-libvirt-9.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-2-8-1-libvirt-9.outputs.REF_SHA_VARIANT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + # This step generates the docker tags - name: Prepare id: prep-2-8-1-libvirt-8 @@ -532,6 +666,140 @@ jobs: cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + # This step generates the docker tags + - name: Prepare + id: prep-2-7-0-libvirt-10 + run: | + set -e + + # Get ref, i.e. from refs/heads/, or from refs/tags/. E.g. 'master' or 'v0.0.0' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + + # Get short commit hash E.g. 'abc0123' + SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # Generate docker image tags + # E.g. 'v0.0.0-' and 'v0.0.0-abc0123-' + # E.g. 'master-' and 'master-abc0123-' + VARIANT="2.7.0-libvirt-10" + REF_VARIANT="${REF}-${VARIANT}" + REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}" + + # Pass variables to next step + echo "VARIANT_BUILD_DIR=$VARIANT_BUILD_DIR" >> $GITHUB_OUTPUT + echo "VARIANT=$VARIANT" >> $GITHUB_OUTPUT + echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT + echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT + + - name: 2.7.0-libvirt-10 - Build (PRs) + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v5 + with: + context: variants/2.7.0-libvirt-10 + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + push: false + tags: | + ${{ github.repository }}:${{ steps.prep-2-7-0-libvirt-10.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-2-7-0-libvirt-10.outputs.REF_SHA_VARIANT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + - name: 2.7.0-libvirt-10 - Build and push (master) + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v5 + with: + context: variants/2.7.0-libvirt-10 + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + push: true + tags: | + ${{ github.repository }}:${{ steps.prep-2-7-0-libvirt-10.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-2-7-0-libvirt-10.outputs.REF_SHA_VARIANT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + - name: 2.7.0-libvirt-10 - Build and push (release) + if: startsWith(github.ref, 'refs/tags/') + uses: docker/build-push-action@v5 + with: + context: variants/2.7.0-libvirt-10 + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + push: true + tags: | + ${{ github.repository }}:${{ steps.prep-2-7-0-libvirt-10.outputs.VARIANT }} + ${{ github.repository }}:${{ steps.prep-2-7-0-libvirt-10.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-2-7-0-libvirt-10.outputs.REF_SHA_VARIANT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + # This step generates the docker tags + - name: Prepare + id: prep-2-7-0-libvirt-9 + run: | + set -e + + # Get ref, i.e. from refs/heads/, or from refs/tags/. E.g. 'master' or 'v0.0.0' + REF=$( echo "${GITHUB_REF}" | rev | cut -d '/' -f 1 | rev ) + + # Get short commit hash E.g. 'abc0123' + SHA=$( echo "${GITHUB_SHA}" | cut -c1-7 ) + + # Generate docker image tags + # E.g. 'v0.0.0-' and 'v0.0.0-abc0123-' + # E.g. 'master-' and 'master-abc0123-' + VARIANT="2.7.0-libvirt-9" + REF_VARIANT="${REF}-${VARIANT}" + REF_SHA_VARIANT="${REF}-${SHA}-${VARIANT}" + + # Pass variables to next step + echo "VARIANT_BUILD_DIR=$VARIANT_BUILD_DIR" >> $GITHUB_OUTPUT + echo "VARIANT=$VARIANT" >> $GITHUB_OUTPUT + echo "REF_VARIANT=$REF_VARIANT" >> $GITHUB_OUTPUT + echo "REF_SHA_VARIANT=$REF_SHA_VARIANT" >> $GITHUB_OUTPUT + + - name: 2.7.0-libvirt-9 - Build (PRs) + # Run only on pull requests + if: github.event_name == 'pull_request' + uses: docker/build-push-action@v5 + with: + context: variants/2.7.0-libvirt-9 + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + push: false + tags: | + ${{ github.repository }}:${{ steps.prep-2-7-0-libvirt-9.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-2-7-0-libvirt-9.outputs.REF_SHA_VARIANT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + - name: 2.7.0-libvirt-9 - Build and push (master) + # Run only on master + if: github.ref == 'refs/heads/master' + uses: docker/build-push-action@v5 + with: + context: variants/2.7.0-libvirt-9 + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + push: true + tags: | + ${{ github.repository }}:${{ steps.prep-2-7-0-libvirt-9.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-2-7-0-libvirt-9.outputs.REF_SHA_VARIANT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + + - name: 2.7.0-libvirt-9 - Build and push (release) + if: startsWith(github.ref, 'refs/tags/') + uses: docker/build-push-action@v5 + with: + context: variants/2.7.0-libvirt-9 + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + push: true + tags: | + ${{ github.repository }}:${{ steps.prep-2-7-0-libvirt-9.outputs.VARIANT }} + ${{ github.repository }}:${{ steps.prep-2-7-0-libvirt-9.outputs.REF_VARIANT }} + ${{ github.repository }}:${{ steps.prep-2-7-0-libvirt-9.outputs.REF_SHA_VARIANT }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max + # This step generates the docker tags - name: Prepare id: prep-2-7-0-libvirt-8 diff --git a/README.md b/README.md index baff463..3417cb5 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,15 @@ Dockerized [`webhook`](https://github.com/adnanh/webhook) with useful tools. | Tag | Dockerfile Build Context | |:-------:|:---------:| | `:2.8.1`, `:latest` | [View](variants/2.8.1) | +| `:2.8.1-libvirt-10` | [View](variants/2.8.1-libvirt-10) | +| `:2.8.1-libvirt-9` | [View](variants/2.8.1-libvirt-9) | | `:2.8.1-libvirt-8` | [View](variants/2.8.1-libvirt-8) | | `:2.8.1-curl-git-jq-sops-ssh` | [View](variants/2.8.1-curl-git-jq-sops-ssh) | | `:2.8.1-libvirt-7` | [View](variants/2.8.1-libvirt-7) | | `:2.8.1-libvirt-6` | [View](variants/2.8.1-libvirt-6) | | `:2.7.0` | [View](variants/2.7.0) | +| `:2.7.0-libvirt-10` | [View](variants/2.7.0-libvirt-10) | +| `:2.7.0-libvirt-9` | [View](variants/2.7.0-libvirt-9) | | `:2.7.0-libvirt-8` | [View](variants/2.7.0-libvirt-8) | | `:2.7.0-curl-git-jq-sops-ssh` | [View](variants/2.7.0-curl-git-jq-sops-ssh) | | `:2.7.0-libvirt-7` | [View](variants/2.7.0-libvirt-7) | diff --git a/generate/definitions/VARIANTS.ps1 b/generate/definitions/VARIANTS.ps1 index 79aaca4..aba465c 100644 --- a/generate/definitions/VARIANTS.ps1 +++ b/generate/definitions/VARIANTS.ps1 @@ -12,6 +12,16 @@ $local:VARIANTS_MATRIX = @( distro_version = '3.20' subvariants = @( @{ components = @() } + @{ components = @( 'libvirt-10' ) } + ) + } + @{ + package = 'webhook' + package_version = $v + distro = 'alpine' + distro_version = '3.19' + subvariants = @( + @{ components = @( 'libvirt-9' ) } ) } @{ diff --git a/variants/2.7.0-libvirt-10/Dockerfile b/variants/2.7.0-libvirt-10/Dockerfile new file mode 100644 index 0000000..094a87e --- /dev/null +++ b/variants/2.7.0-libvirt-10/Dockerfile @@ -0,0 +1,28 @@ +FROM golang:1.20-alpine as builder +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN set -eux; \ + apk add --no-cache git; \ + git clone https://github.com/adnanh/webhook.git /src --branch 2.7.0; \ + cd /src; \ + go build -ldflags="-s -w" -o /usr/local/bin/webhook; + +FROM alpine:3.20 +COPY --from=builder /usr/local/bin/webhook /usr/local/bin/webhook +RUN webhook --version + +RUN apk add --no-cache ca-certificates + +# Install Task Spooler +RUN apk add --no-cache ts + +RUN apk add --no-cache libvirt-client +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod +x docker-entrypoint.sh + +WORKDIR /config +ENTRYPOINT [ "/docker-entrypoint.sh" ] +EXPOSE 9000 +CMD [ "-verbose", "-hooks=/config/hooks.yml", "-hotreload" ] diff --git a/variants/2.7.0-libvirt-10/docker-entrypoint.sh b/variants/2.7.0-libvirt-10/docker-entrypoint.sh new file mode 100644 index 0000000..ff38c47 --- /dev/null +++ b/variants/2.7.0-libvirt-10/docker-entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu + +if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then + set -- webhook "$@" +fi + +exec "$@" \ No newline at end of file diff --git a/variants/2.7.0-libvirt-9/Dockerfile b/variants/2.7.0-libvirt-9/Dockerfile new file mode 100644 index 0000000..90ed98c --- /dev/null +++ b/variants/2.7.0-libvirt-9/Dockerfile @@ -0,0 +1,28 @@ +FROM golang:1.20-alpine as builder +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN set -eux; \ + apk add --no-cache git; \ + git clone https://github.com/adnanh/webhook.git /src --branch 2.7.0; \ + cd /src; \ + go build -ldflags="-s -w" -o /usr/local/bin/webhook; + +FROM alpine:3.19 +COPY --from=builder /usr/local/bin/webhook /usr/local/bin/webhook +RUN webhook --version + +RUN apk add --no-cache ca-certificates + +# Install Task Spooler +RUN apk add --no-cache ts + +RUN apk add --no-cache libvirt-client +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod +x docker-entrypoint.sh + +WORKDIR /config +ENTRYPOINT [ "/docker-entrypoint.sh" ] +EXPOSE 9000 +CMD [ "-verbose", "-hooks=/config/hooks.yml", "-hotreload" ] diff --git a/variants/2.7.0-libvirt-9/docker-entrypoint.sh b/variants/2.7.0-libvirt-9/docker-entrypoint.sh new file mode 100644 index 0000000..ff38c47 --- /dev/null +++ b/variants/2.7.0-libvirt-9/docker-entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu + +if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then + set -- webhook "$@" +fi + +exec "$@" \ No newline at end of file diff --git a/variants/2.8.1-libvirt-10/Dockerfile b/variants/2.8.1-libvirt-10/Dockerfile new file mode 100644 index 0000000..d4490f6 --- /dev/null +++ b/variants/2.8.1-libvirt-10/Dockerfile @@ -0,0 +1,28 @@ +FROM golang:1.20-alpine as builder +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN set -eux; \ + apk add --no-cache git; \ + git clone https://github.com/adnanh/webhook.git /src --branch 2.8.1; \ + cd /src; \ + go build -ldflags="-s -w" -o /usr/local/bin/webhook; + +FROM alpine:3.20 +COPY --from=builder /usr/local/bin/webhook /usr/local/bin/webhook +RUN webhook --version + +RUN apk add --no-cache ca-certificates + +# Install Task Spooler +RUN apk add --no-cache ts + +RUN apk add --no-cache libvirt-client +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod +x docker-entrypoint.sh + +WORKDIR /config +ENTRYPOINT [ "/docker-entrypoint.sh" ] +EXPOSE 9000 +CMD [ "-verbose", "-hooks=/config/hooks.yml", "-hotreload" ] diff --git a/variants/2.8.1-libvirt-10/docker-entrypoint.sh b/variants/2.8.1-libvirt-10/docker-entrypoint.sh new file mode 100644 index 0000000..ff38c47 --- /dev/null +++ b/variants/2.8.1-libvirt-10/docker-entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu + +if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then + set -- webhook "$@" +fi + +exec "$@" \ No newline at end of file diff --git a/variants/2.8.1-libvirt-9/Dockerfile b/variants/2.8.1-libvirt-9/Dockerfile new file mode 100644 index 0000000..87d3dc8 --- /dev/null +++ b/variants/2.8.1-libvirt-9/Dockerfile @@ -0,0 +1,28 @@ +FROM golang:1.20-alpine as builder +ARG TARGETPLATFORM +ARG BUILDPLATFORM +RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" + +RUN set -eux; \ + apk add --no-cache git; \ + git clone https://github.com/adnanh/webhook.git /src --branch 2.8.1; \ + cd /src; \ + go build -ldflags="-s -w" -o /usr/local/bin/webhook; + +FROM alpine:3.19 +COPY --from=builder /usr/local/bin/webhook /usr/local/bin/webhook +RUN webhook --version + +RUN apk add --no-cache ca-certificates + +# Install Task Spooler +RUN apk add --no-cache ts + +RUN apk add --no-cache libvirt-client +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod +x docker-entrypoint.sh + +WORKDIR /config +ENTRYPOINT [ "/docker-entrypoint.sh" ] +EXPOSE 9000 +CMD [ "-verbose", "-hooks=/config/hooks.yml", "-hotreload" ] diff --git a/variants/2.8.1-libvirt-9/docker-entrypoint.sh b/variants/2.8.1-libvirt-9/docker-entrypoint.sh new file mode 100644 index 0000000..ff38c47 --- /dev/null +++ b/variants/2.8.1-libvirt-9/docker-entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu + +if [ $# -gt 0 ] && [ "${1#-}" != "$1" ]; then + set -- webhook "$@" +fi + +exec "$@" \ No newline at end of file