Something went wrong. Try again.
Container images for the Tangled Knot and Spindle servers
Something went wrong. Try again.
tangled-containers Dockerfile
1.7 kB · 56 lines
Dockerfile
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657FROM golang:alpine AS buildFROM alpine AS runtime
FROM build AS tangled# earliest version with knot & spindleARG TANGLED_VERSION=v1.6.0-alphaENV URL=https://tangled.org/tangled.org/core/archive/${TANGLED_VERSION}RUN wget -O '-' $URL | tar -zxvf '-'RUN mv core-${TANGLED_VERSION} /coreWORKDIR /coreRUN go mod download
FROM build AS build-spindleWORKDIR /appCOPY --from=tangled /core .RUN go build -o spindle cmd/spindle/main.go
FROM build AS build-knotWORKDIR /appCOPY --from=tangled /core .RUN go build -o knot cmd/knot/main.go
FROM runtime AS spindleENV SPINDLE_SERVER_DB_PATH=/var/lib/spindle/spindle.dbRUN addgroup --system --gid 1001 spindleRUN adduser --system --uid 1001 spindleRUN mkdir -p /var/{lib,log}/spindleCOPY --from=build_spindle /app/spindle /usr/bin/spindleEXPOSE 6555USER spindleVOLUME ["/var/log/spindle", "/var/lib/spindle"]CMD ["spindle"]
FROM runtime AS knotARG UID=1001ARG GID=1001ENV KNOT_SERVER_DB_PATH=/home/git/knotserver.dbENV KNOT_REPO_SCAN_PATH=/home/git/repositoriesENV KNOT_SERVER_INTERNAL_LISTEN_ADDR=localhost:5444COPY knot .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 /app/knot /usr/bin/knotEXPOSE 5555EXPOSE 22USER gitWORKDIR /home/gitVOLUME ["/home/git", "/etc/ssh/keys"]ENTRYPOINT ["/init"]HEALTHCHECK --interval=60s --timeout=30s --start-period=5s --retries=3 \ CMD curl -f http://localhost:5555 || exit 1