Added Shareforge Yolk

This commit is contained in:
Kyle Speight
2025-10-11 12:48:07 -07:00
parent 0966933877
commit c720dd8518
3 changed files with 85 additions and 0 deletions
+47
View File
@@ -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) || '' }}
+18
View File
@@ -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"]
+20
View File
@@ -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"