upgrade gitea-runner setup with compilation, and better socket handling

This commit is contained in:
Maciej Lebiest 2023-11-18 13:10:30 +01:00
parent ced51b9d8e
commit 746bd5d6be
2 changed files with 17 additions and 9 deletions

View file

@ -177,7 +177,7 @@ docker runner.
Example uses root, but it should be very similar to setup under non-root user.
Build image setting proper platform architecture `amd64`, `arm64`, etc...
Build image (will compile from main branch)
```bash
podman build --no-cache -t gitea-runner \
--build-arg ARCH="arm64" \
@ -234,11 +234,11 @@ podman run --rm -d --privileged --name gitea-podman \
system service --time=0 unix:///podman/docker.sock
```
Now start container with runner (it will fail if docker.sock is missing)
Now start container with runner
```bash
podman run --rm -d --name gitea-runner \
-v /root/act-runner/runner/:/etc/runner:ro,Z \
-v /root/act-runner/podman/docker.sock:/var/run/docker.sock:rw,z \
-v /root/act-runner/podman:/podman:rw,z \
gitea-runner:latest \
daemon -c /etc/runner/config.yaml
```

View file

@ -1,12 +1,20 @@
FROM quay.io/podman/stable
ENV VERSION="0.2.6"
ARG ARCH="amd64"
RUN mkdir -p /opt /var/run && \
ln -sf /podman/docker.sock /var/run/docker.sock
RUN curl -o /act_runner https://gitea.com/gitea/act_runner/releases/download/v0.2.6/act_runner-${VERSION}-linux-${ARCH} && \
chmod +x /act_runner && \
chown podman /act_runner
RUN dnf install -y make go git && \
cd /tmp && \
git clone https://gitea.com/gitea/act_runner.git && \
cd act_runner && \
make build && \
mv /tmp/act_runner/act_runner /opt/ && \
chown podman /opt/act_runner && \
dnf remove -y make go git && \
dnf autoremove -y && \
dnf clean all && \
rm -rf /tmp/* /root/go
USER podman
ENTRYPOINT [ "/act_runner" ]
ENTRYPOINT [ "/opt/act_runner" ]