Something went wrong. Try again.
Personal docker image setups for Knot/Spindle
Something went wrong. Try again.
knot-spindle-docker Dockerfile
2.3 kB · 72 lines
Dockerfile
at main
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273FROM golang:1.25-alpine AS builderENV KNOT_REPO_SCAN_PATH=/home/git/repositoriesENV CGO_ENABLED=1
ARG TAG='v1.16.0-alpha'
WORKDIR /appRUN apk add git gcc musl-devRUN git clone -b ${TAG} https://tangled.org/tangled.org/core .
FROM builder AS build-knotRUN go build -o /usr/bin/knot -ldflags '-s -w -extldflags "-static"' ./cmd/knot
FROM builder AS build-spindleRUN go build -o /usr/bin/spindle -ldflags '-s -w -extldflags "-static"' ./cmd/spindle
FROM alpine:latest AS knotEXPOSE 5555EXPOSE 22
LABEL org.opencontainers.image.title='knot'LABEL org.opencontainers.image.description='data server for tangled'LABEL org.opencontainers.image.source='https://tangled.org/sachy.dev/knot-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=1000ARG GID=1000
COPY rootfs .RUN chmod 755 /etcRUN chmod -R 755 /etc/s6-overlayRUN apk add shadow s6-overlay execline openssl openssh git curl bashRUN groupadd -g $GID -f gitRUN useradd -u $UID -g $GID -d /home/git gitRUN openssl rand -hex 16 | passwd --stdin gitRUN mkdir -p /home/git/repositories && chown -R git:git /home/gitCOPY --from=build-knot /usr/bin/knot /usr/binRUN mkdir /app && chown -R git:git /app
HEALTHCHECK --interval=60s --timeout=30s --start-period=5s --retries=3 \ CMD curl -f http://localhost:5555 || exit 1
ENTRYPOINT ["/init"]
FROM alpine:latest AS spindle
EXPOSE 6555
LABEL org.opencontainers.image.title="spindle"LABEL org.opencontainers.image.description="ci server for tangled"LABEL org.opencontainers.image.source="https://tangled.org/sachy.dev/knot-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=1000ARG GID=1000
RUN adduser --system --uid $UID spindleRUN addgroup --system --gid $UID spindleRUN mkdir -p /app && chown -R spindle:spindle /appRUN mkdir -p /images && chown -R spindle:spindle /imagesRUN apk add git curlCOPY --from=build-spindle /usr/bin/spindle /usr/bin
WORKDIR /appCMD ["spindle"]VOLUME ["/app"]HEALTHCHECK --interval=60s --timeout=30s --start-period=5s --retries=3 \ CMD curl -f http://localhost:6555 || exit 1