From c720dd8518fab57c361847e6913310f2ffae1d12 Mon Sep 17 00:00:00 2001 From: Kyle Speight Date: Sat, 11 Oct 2025 12:48:07 -0700 Subject: [PATCH] Added Shareforge Yolk --- .github/workflows/shareforge.yaml | 47 +++++++++++++++++++++++++++++++ shareforge/1.41.4/Dockerfile | 18 ++++++++++++ shareforge/entrypoint.sh | 20 +++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 .github/workflows/shareforge.yaml create mode 100644 shareforge/1.41.4/Dockerfile create mode 100644 shareforge/entrypoint.sh diff --git a/.github/workflows/shareforge.yaml b/.github/workflows/shareforge.yaml new file mode 100644 index 0000000..510a076 --- /dev/null +++ b/.github/workflows/shareforge.yaml @@ -0,0 +1,47 @@ +name: build shareforge +on: + workflow_dispatch: + schedule: + - cron: "0 0 * * 1" + push: + branches: + - master + paths: + - shareforge/** +permissions: + packages: write + +jobs: + push: + name: "kylehost:shareforge_${{ matrix.tag }}" + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + tag: + - '1.41.4' + steps: + - uses: actions/checkout@v4 + # Setup QEMU for ARM64 Build + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + with: + buildkitd-flags: --debug + - id: lower-repo + name: Repository to lowercase + run: | + echo "repository=${GITHUB_REPOSITORY_OWNER@L}" >> $GITHUB_OUTPUT + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ steps.lower-repo.outputs.repository }} + password: ${{ secrets.REGISTRY_TOKEN || secrets.GITHUB_TOKEN }} + - uses: docker/build-push-action@v6 + with: + context: ./shareforge + file: ./shareforge/${{ matrix.tag }}/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: | + ghcr.io/${{ steps.lower-repo.outputs.repository }}/yolks:python_${{ matrix.tag }} + ${{ github.repository_owner == 'kylehost' && format('ghcr.io/kylehost/yolks:shareforge_{0}', matrix.tag) || '' }} diff --git a/shareforge/1.41.4/Dockerfile b/shareforge/1.41.4/Dockerfile new file mode 100644 index 0000000..46940a8 --- /dev/null +++ b/shareforge/1.41.4/Dockerfile @@ -0,0 +1,18 @@ +FROM --platform=$TARGETOS/$TARGETARCH python:3.12-slim-bookworm + +LABEL author="Kyle Speight" maintainer="kyle@kyle-hosting.de" + +RUN apt update \ + && apt -y install git gcc g++ ca-certificates dnsutils curl iproute2 ffmpeg procps tini \ + && useradd -m -d /home/container container + +USER container +ENV USER=container HOME=/home/container +WORKDIR /home/container + +STOPSIGNAL SIGINT + +COPY --chown=container:container ./../entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh +ENTRYPOINT ["/usr/bin/tini", "-g", "--"] +CMD ["/entrypoint.sh"] diff --git a/shareforge/entrypoint.sh b/shareforge/entrypoint.sh new file mode 100644 index 0000000..235d6bf --- /dev/null +++ b/shareforge/entrypoint.sh @@ -0,0 +1,20 @@ +#!/bin/bash +cd /home/container + +# Make internal Docker IP address available to processes. +INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}') +export INTERNAL_IP + +# Print current Python version +python --version + +# Convert all of the "{{VARIABLE}}" parts of the command into the expected shell +# variable format of "${VARIABLE}" before evaluating the string and automatically +# replacing the values. +PARSED=$(echo "$STARTUP" | sed -e 's/{{/${/g' -e 's/}}/}/g') + +# Display the command we're running in the output, and then execute it with eval +printf "\033[1m\033[33mcontainer~ \033[0m" +echo "$PARSED" +# shellcheck disable=SC2086 +eval "$PARSED"