FROM golang:1.24-alpine AS builder ENV CGO_ENABLED=1 ARG TAG='v1.10.0-alpha' WORKDIR /app RUN apk add git gcc musl-dev RUN git clone -b ${TAG} https://tangled.org/@tangled.org/core . RUN go build -o /usr/bin/spindle -ldflags '-s -w -extldflags "-static"' ./cmd/spindle FROM alpine:edge ARG PORT=6555 EXPOSE $PORT LABEL org.opencontainers.image.title='spindle' LABEL org.opencontainers.image.description='CI runner for tangled' LABEL org.opencontainers.image.source='https://tangled.org/@keea.dog/spindle-docker' LABEL org.opencontainers.image.url='https://tangled.org' LABEL org.opencontainers.image.vendor='tangled.org' LABEL org.opencontainers.image.licenses='MIT' ARG UID=1000 ARG GID=1000 COPY rootfs . RUN chmod 755 /etc RUN chmod -R 755 /etc/s6-overlay RUN apk add shadow s6-overlay execline openssl curl RUN groupadd -g $GID -f spindle RUN useradd -u $UID -g $GID -d /home/spindle spindle RUN openssl rand -hex 16 | passwd --stdin spindle RUN mkdir -p /home/spindle/repositories && chown -R spindle:spindle /home/spindle COPY --from=builder /usr/bin/spindle /usr/bin RUN mkdir /app && chown -R spindle:spindle /app HEALTHCHECK --interval=60s --timeout=30s --start-period=5s --retries=3 \ CMD curl -f http://localhost:${PORT} || exit 1 ENTRYPOINT ["/init"]