Nicer build

This commit is contained in:
Neale Pickett 2024-01-05 00:00:02 -07:00
parent b3b8563b02
commit 5e07b55cd1
4 changed files with 34 additions and 36 deletions

27
Containerfile Normal file
View File

@ -0,0 +1,27 @@
FROM public.ecr.aws/debian/debian:stable AS base
RUN apt-get -y update; apt-get -y install --no-install-recommends \
build-essential \
podman \
arduino \
rsync \
openssh-client \
python3 \
curl \
git
COPY --from=big-builder:golang /opt/go /opt/go/
RUN ln -s /opt/go/bin/* /usr/local/bin/
FROM base AS runner
RUN curl -L https://gitea.com/gitea/act_runner/archive/v0.2.6.tar.gz | gunzip | tar x -C /opt
RUN CGO_ENABLED=0 make -C /opt/act_runner build
FROM base
COPY --from=runner /opt/act_runner/act_runner /usr/local/bin/
RUN apt-get -y install \
hugo
RUN apt-get -y install \
uidmap
RUN useradd builder -md /app
USER builder
WORKDIR /app
ENTRYPOINT [ "/usr/local/bin/act_runner" ]

View File

@ -1,25 +0,0 @@
FROM alpine AS base
RUN apk --no-cache add \
build-base \
hugo \
rsync \
openssh-client \
python3 \
curl \
ca-certificates \
git
RUN curl -L https://go.dev/dl/go1.21.3.linux-armv6l.tar.gz | gunzip | tar x -C /opt -f -
RUN ln -s /opt/go/bin/* /usr/local/bin/
FROM base AS runner-build
WORKDIR /src
RUN git clone https://gitea.com/gitea/act_runner
RUN CGO_ENABLED=0 make -C act_runner build
FROM base
COPY --from=runner-build /src/act_runner/act_runner /usr/local/bin
RUN adduser -D builder
USER builder
WORKDIR /app
ENTRYPOINT [ "/usr/local/bin/act_runner" ]

View File

@ -47,7 +47,7 @@ Make your own image. Like so:
```Dockerfile ```Dockerfile
FROM git.woozle.org/neale/big-builder FROM git.woozle.org/neale/big-builder
RUN apk --no-cache add nethack RUN apt-get -y install nethack
``` ```
Even better, steal this one's Dockerfile and add stuff to it. Even better, steal this one's Dockerfile and add stuff to it.
@ -65,13 +65,3 @@ This is a problem with the runner that they might fix one day.
Just something to bear in mind: Just something to bear in mind:
I spent a bit of time chasing this one down. I spent a bit of time chasing this one down.
Note To Self
------------
```sh
~/runner/run.sh
```
I think I did it this way to isolate it from the rest of the homelab swarm?
But then why not just make a new swarm?

6
build.sh Executable file
View File

@ -0,0 +1,6 @@
#! /bin/sh
set -e
podman build --tag=git.woozle.org/neale/big-builder:1.1 -f Containerfile .
podman push git.woozle.org/neale/big-builder:1.1