FROM golang:1.25-alpine AS builder ARG TAG='v1.11.0-alpha' ENV CGO_ENABLED=1 WORKDIR /app RUN apk add --no-cache git gcc musl-dev RUN echo "${TAG}" > /VERSION && \ echo "Building tag: ${TAG}" && \ git clone -b "${TAG}" https://tangled.org/@tangled.org/core . RUN go build -o /usr/bin/knot -ldflags '-s -w -extldflags "-static"' ./cmd/knot FROM alpine:latest EXPOSE 2222 EXPOSE 5555 RUN apk add --no-cache shadow s6-overlay execline openssl openssh git curl bash COPY --from=builder /usr/bin/knot /usr/bin COPY --from=builder /VERSION / COPY rootfs / ARG UID=1000 ARG GID=1000 RUN groupadd -g $GID git && \ useradd -u $UID -g git -m -d /home/git -s /bin/bash -p "*" git && \ mkdir -p /etc/ssh/keys && \ chmod 755 /etc && \ chmod -R 755 /etc/s6-overlay USER git ENTRYPOINT ["/init"]