This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

core / localinfra / spindle.Dockerfile
2.0 kB 71 lines
1# Development only. Not for production use. 2 3FROM golang:1.25-alpine AS builder 4 5RUN apk add --no-cache git build-base sqlite-dev 6 7ENV CGO_ENABLED=1 8ENV GOCACHE=/go/cache 9ENV GOMODCACHE=/go/mod 10 11WORKDIR /src 12 13COPY go.mod go.sum ./ 14RUN --mount=type=cache,target=/go/cache \ 15 --mount=type=cache,target=/go/mod \ 16 go mod download 17 18COPY . . 19RUN --mount=type=cache,target=/go/cache \ 20 --mount=type=cache,target=/go/mod \ 21 go build -tags libsqlite3 -o /out/spindle ./cmd/spindle && \ 22 go build -tags libsqlite3 -o /out/spindle-microvm-run ./cmd/spindle-microvm-run 23 24FROM alpine:3.24 25 26RUN apk add --no-cache \ 27 bash \ 28 ca-certificates \ 29 e2fsprogs \ 30 git \ 31 iproute2 \ 32 qemu-system-x86_64 \ 33 shadow \ 34 slirp4netns \ 35 sqlite-libs \ 36 tini \ 37 util-linux 38 39 40COPY --from=builder /out/spindle /usr/local/bin/spindle 41COPY --from=builder /out/spindle-microvm-run /usr/local/bin/spindle-microvm-run 42RUN chmod 0755 /usr/local/bin/spindle /usr/local/bin/spindle-microvm-run 43 44COPY <<'EOF' /usr/local/bin/spindle-entrypoint.sh 45#!/bin/sh 46set -eu 47 48[ -z "${SPINDLE_SERVER_OWNER:-}" ] && [ -r /shared/owner-did ] && \ 49 export SPINDLE_SERVER_OWNER="$(cat /shared/owner-did)" 50: "${SPINDLE_SERVER_OWNER:?set via env or /shared/owner-did}" 51 52# executors read their mill token from a file seeded by the mill-tokens 53# service (command substitution strips the trailing newline) 54[ -z "${SPINDLE_MILL_SHARED_SECRET:-}" ] && [ -n "${SPINDLE_MILL_TOKEN_FILE:-}" ] && [ -r "${SPINDLE_MILL_TOKEN_FILE}" ] && \ 55 export SPINDLE_MILL_SHARED_SECRET="$(cat "${SPINDLE_MILL_TOKEN_FILE}")" 56 57mkdir -p /var/lib/spindle /var/lib/spindle/overlays /var/log/spindle 58 59if [ -f /usr/local/share/ca-certificates/caddy.crt ]; then 60 update-ca-certificates 61fi 62 63exec /usr/local/bin/spindle run 64EOF 65RUN chmod +x /usr/local/bin/spindle-entrypoint.sh 66 67VOLUME /var/lib/spindle 68EXPOSE 6555 69 70ENTRYPOINT ["/sbin/tini", "--"] 71CMD ["/usr/local/bin/spindle-entrypoint.sh"]