Something went wrong. Try again.
Community maintained Docker config for the knot server forked from psychedeli.ca/knot-docker
Something went wrong. Try again.
knot-docker Dockerfile
3.0 kB · 94 lines
Dockerfile
at unstable
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495from golang:1.26-alpine as builder
env CGO_ENABLED=1env GOCACHE=/go/cacheenv GOMODCACHE=/go/mod
workdir /app
run --mount=type=cache,target=/var/cache/apk,sharing=locked \ apk add --update-cache gcc musl-dev patch
add https://tangled.org/tangled.org/core/archive/sv-fe.tar.gz .run tar -xzf sv-fe.tar.gz --strip-components=1run rm sv-fe.tar.gz
copy patches /patchesrun patch -p1 < /patches/vcpu-topology.patch
run --mount=type=cache,target=/go/cache \ --mount=type=cache,target=/go/mod \ go mod download
from builder as build-knotrun --mount=type=cache,target=/go/cache \ --mount=type=cache,target=/go/mod \ go build -o /usr/bin/knot -ldflags '-s -w -extldflags "-static"' ./cmd/knot
from builder as build-spindlerun --mount=type=cache,target=/go/cache \ --mount=type=cache,target=/go/mod \ go build -o /usr/bin/spindle -ldflags '-s -w -extldflags "-static"' ./cmd/spindle
from alpine:latest as knotenv KNOT_REPO_SCAN_PATH=/home/git/repositoriesexpose 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/@tangled.org/knot-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 --mount=type=cache,target=/var/cache/apk,sharing=locked \ apk add --update-cache shadow s6-overlay execline openssl openssh git curl bashrun groupadd -g $GID -f gitrun useradd -l -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 1entrypoint ["/init"]
from alpine:edge as spindleexpose 6555
label org.opencontainers.image.title="spindle"label org.opencontainers.image.description="ci server for tangled"label org.opencontainers.image.source="https://tangled.org/@tangled.org/knot-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 --mount=type=cache,target=/var/cache/apk,sharing=locked \ apk add --update-cache shadow git curl bash e2fsprogs iproute2 qemu-system-x86_64 slirp4netns util-linux
run adduser --system --uid $UID spindlerun addgroup --system --gid $UID spindlerun mkdir -p /app && chown -R spindle:spindle /app
copy --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