Podman config for the Tangled Knot server.
1FROM golang:1.25-alpine AS builder
2
3ARG TAG='v1.11.0-alpha'
4
5ENV CGO_ENABLED=1
6
7WORKDIR /app
8RUN apk add --no-cache git gcc musl-dev
9RUN echo "${TAG}" > /VERSION && \
10 echo "Building tag: ${TAG}" && \
11 git clone -b "${TAG}" https://tangled.org/@tangled.org/core .
12RUN go build -o /usr/bin/knot -ldflags '-s -w -extldflags "-static"' ./cmd/knot
13
14FROM alpine:latest
15
16EXPOSE 2222
17EXPOSE 5555
18
19RUN apk add --no-cache shadow s6-overlay execline openssl openssh git curl bash
20
21COPY --from=builder /usr/bin/knot /usr/bin
22COPY --from=builder /VERSION /
23COPY rootfs /
24
25ARG UID=1000
26ARG GID=1000
27
28RUN groupadd -g $GID git && \
29 useradd -u $UID -g git -m -d /home/git -s /bin/bash -p "*" git && \
30 mkdir -p /etc/ssh/keys && \
31 chmod 755 /etc && \
32 chmod -R 755 /etc/s6-overlay
33
34USER git
35
36ENTRYPOINT ["/init"]