File tree Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 1616 - name : Run podman build - base
1717 run : |
1818 podman build -t ghcr.io/gbraad-homelab/forgejo/bootc:latest \
19+ --build-arg=ADMIN_PASSWD="password" \
1920 --build-arg=BASE_IMAGE="ghcr.io/gbraad-homelab/private-base/bootc" \
2021 --build-arg=BASE_VERSION="latest" \
2122 -f containers/Containerfile .
Original file line number Diff line number Diff line change 1414 - name : Check out repository code
1515 uses : actions/checkout@v4
1616 - name : Run podman build - base
17- run : podman build -t ghcr.io/gbraad-homelab/forgejo:latest -f containers/Containerfile .
17+ run : |
18+ podman build -t ghcr.io/gbraad-homelab/forgejo:latest \
19+ --build-arg=ADMIN_PASSWD="password" \
20+ -f containers/Containerfile .
1821 - name : Push image to ghcr.io - base
19- run : podman push --creds=${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} ghcr.io/gbraad-homelab/forgejo:latest
22+ run : |
23+ podman push --creds=${{ github.actor }}:${{ secrets.GITHUB_TOKEN }} \
24+ ghcr.io/gbraad-homelab/forgejo:latest
Original file line number Diff line number Diff line change @@ -3,6 +3,16 @@ ARG BASE_VERSION="latest"
33
44FROM ${BASE_IMAGE}:${BASE_VERSION}
55
6+ # Create a default 'admin' user with the specified password.
7+ # Add it to the 'wheel' group to allow for running sudo commands.
8+ ARG ADMIN_PASSWD
9+ # hadolint ignore=DL4006
10+ RUN if [ -z "${ADMIN_PASSWD}" ] ; then \
11+ echo "ADMIN_PASSWD is a mandatory build argument" && exit 1 ; \
12+ fi \
13+ && useradd -m -d /var/home/admin -G wheel admin \
14+ && echo "admin:${ADMIN_PASSWD}" | chpasswd
15+
616RUN dnf install -y git git-lfs openssh-server \
717 && dnf clean all \
818 && rm -rf /var/cache/yum \
@@ -12,9 +22,8 @@ RUN dnf install -y git git-lfs openssh-server \
1222 && sed -i 's/HOME=\/ home\/ git/HOME=\/ var\/ home\/ git/' /etc/systemd/system/forgejo.service \
1323 && systemctl enable forgejo.service \
1424 && systemctl enable sshd.service \
15- && chmod 640 /etc/shadow
16-
17- RUN mkdir -p /var/home/ \
25+ && chmod 640 /etc/shadow \
26+ && mkdir -p /var/home/ \
1827 && groupadd --system git \
1928 && useradd --system --shell /bin/bash --comment 'Git Version Control' --gid git --home-dir /var/home/git --create-home git \
2029 && mkdir /var/lib/forgejo \
You can’t perform that action at this time.
0 commit comments