tangled
alpha
login
or
join now
psychedeli.ca
/
knot-docker
forked from
tangled.org/knot-docker
0
fork
atom
Community maintained Docker config for the knot server
0
fork
atom
overview
issues
pulls
pipelines
add build stage for the spindle server
psychedeli.ca
4 months ago
cbda62f0
c0af00f2
verified
This commit was signed with the committer's
known signature
.
psychedeli.ca
SSH Key Fingerprint:
SHA256:lxA4UZo3m7mVMluMNbOrpavEOBPMDc7Vh521+i80n50=
+34
-5
1 changed file
expand all
collapse all
unified
split
Dockerfile
+34
-5
Dockerfile
···
1
1
from golang:1.24-alpine as builder
2
2
-
env KNOT_REPO_SCAN_PATH=/home/git/repositories
3
2
env CGO_ENABLED=1
4
3
5
4
arg TAG='v1.10.0-alpha'
···
7
6
workdir /app
8
7
run apk add git gcc musl-dev
9
8
run git clone -b ${TAG} https://tangled.org/@tangled.org/core .
10
10
-
run go build -o /usr/bin/knot -ldflags '-s -w -extldflags "-static"' ./cmd/knot
11
9
12
12
-
from alpine:edge
10
10
+
FROM builder AS build-knot
11
11
+
RUN go build -o /usr/bin/knot -ldflags '-s -w -extldflags "-static"' ./cmd/knot
12
12
+
13
13
+
FROM builder AS build-spindle
14
14
+
RUN go build -o /usr/bin/spindle ./cmd/spindle
15
15
+
16
16
+
from alpine:edge AS knot
17
17
+
ENV KNOT_REPO_SCAN_PATH=/home/git/repositories
13
18
expose 5555
14
19
expose 22
15
20
···
31
36
run useradd -u $UID -g $GID -d /home/git git
32
37
run openssl rand -hex 16 | passwd --stdin git
33
38
run mkdir -p /home/git/repositories && chown -R git:git /home/git
34
34
-
copy --from=builder /usr/bin/knot /usr/bin
39
39
+
copy --from=build-knot /usr/bin/knot /usr/bin
35
40
run mkdir /app && chown -R git:git /app
36
41
37
42
healthcheck --interval=60s --timeout=30s --start-period=5s --retries=3 \
38
43
cmd curl -f http://localhost:5555 || exit 1
44
44
+
entrypoint ["/init"]
39
45
40
40
-
entrypoint ["/init"]
46
46
+
FROM alpine:edge AS spindle
47
47
+
EXPOSE 6555
48
48
+
49
49
+
LABEL org.opencontainers.image.title="spindle"
50
50
+
LABEL org.opencontainers.image.description="ci server for tangled"
51
51
+
LABEL org.opencontainers.image.source="https://tangled.org/@tangled.org/knot-docker"
52
52
+
LABEL org.opencontainers.image.url="https://tangled.org"
53
53
+
LABEL org.opencontainers.image.vendor="tangled.org"
54
54
+
LABEL org.opencontainers.image.licenses="MIT"
55
55
+
56
56
+
ARG UID=1000
57
57
+
ARG GID=1000
58
58
+
59
59
+
RUN groupadd --system -g $GID -f spindle
60
60
+
RUN useradd --system -u $UID -g $GID spindle
61
61
+
RUN mkdir -p /app && chown -R spindle:spindle /app
62
62
+
63
63
+
COPY --from=build-spindle /usr/bin/spindle /usr/bin
64
64
+
65
65
+
WORKDIR /app
66
66
+
CMD ["spindle"]
67
67
+
VOLUME ["/app"]
68
68
+
HEALTHCHECK --interval=60s --timeout=30s --start-period=5s --retries=3 \
69
69
+
CMD curl -f http://localhost:6555 || exit 1