commit d6f06c964a5192fa503c92e43d849420942705336890517f4ac71e0370540d08 Author: Evan Carroll Date: Sat Jun 7 22:10:41 2025 -0500 initial commit diff --git a/forgejo-podman-runner-image/Containerfile b/forgejo-podman-runner-image/Containerfile new file mode 100644 index 0000000..435ce57 --- /dev/null +++ b/forgejo-podman-runner-image/Containerfile @@ -0,0 +1,37 @@ +FROM code.forgejo.org/forgejo/runner:6.3.1 + +USER root + +# Install packages needed for rootless Podman +RUN apk add --no-cache \ + podman \ + fuse-overlayfs \ + shadow-uidmap \ + crun + +# Create runner user and configure for rootless containers +RUN adduser -D -u 1000 runner \ + && echo "runner:100000:65536" >> /etc/subuid \ + && echo "runner:100000:65536" >> /etc/subgid + +# Configure Podman for rootless operation +USER runner +WORKDIR /home/runner + +# Create necessary directories and configuration +RUN mkdir -p ~/.config/containers ~/.local/share/containers \ + && echo 'unqualified-search-registries = ["docker.io"]' > ~/.config/containers/registries.conf \ + && echo '[storage]' > ~/.config/containers/storage.conf \ + && echo 'driver = "overlay"' >> ~/.config/containers/storage.conf \ + && echo 'runroot = "/tmp/containers-user-1000/storage"' >> ~/.config/containers/storage.conf \ + && echo 'graphroot = "/home/runner/.local/share/containers/storage"' >> ~/.config/containers/storage.conf \ + && echo '[storage.options.overlay]' >> ~/.config/containers/storage.conf \ + && echo 'mount_program = "/usr/bin/fuse-overlayfs"' >> ~/.config/containers/storage.conf + +ENV XDG_RUNTIME_DIR=/tmp/runtime-runner +ENV TMPDIR=/tmp + +# Create runtime directory +RUN mkdir -p $XDG_RUNTIME_DIR && chmod 0700 $XDG_RUNTIME_DIR + +ENTRYPOINT ["/bin/forgejo-runner"] \ No newline at end of file diff --git a/forgejo-podman-runner-image/build.sh b/forgejo-podman-runner-image/build.sh new file mode 100755 index 0000000..42dfcbd --- /dev/null +++ b/forgejo-podman-runner-image/build.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +IMAGE_OWNER="EvanCarroll" +IMAGE_NAME="forgejo-podman-runner-image" +IMAGE_FULL="${IMAGE_NAME}:latest" +REPO_PATH="git.coworkunion.com/${IMAGE_OWNER}/${IMAGE_NAME}" +URL="https://${REPO_PATH}" + +# Build the Forgejo runner image with Podman support +# buildah bud -t git.coworkunion.com/evancarroll/forgejo-runner-podman:latest -f Containerfile +buildah bud -t ${IMAGE_FULL} -f Containerfile + +buildah build \ + --label "org.opencontainers.image.source=${URL}" \ + --label "org.opencontainers.image.url=${URL}" \ + --label "org.opencontainers.image.documentation=${URL}" \ + -t "$IMAGE_FULL" . + +buildah push "${IMAGE_FULL}" "${REPO_PATH}" +echo buildah push "${IMAGE_FULL}" "${REPO_PATH}"