···
1
-
from golang:1.24-alpine as builder
2
-
env KNOT_REPO_SCAN_PATH=/home/git/repositories
1
+
FROM golang:1.24-alpine AS builder
2
+
ENV KNOT_REPO_SCAN_PATH=/home/git/repositories
5
-
arg TAG='v1.10.0-alpha'
5
+
ARG TAG='v1.10.0-alpha'
8
-
run apk add git gcc musl-dev
9
-
run git clone -b ${TAG} https://tangled.org/@tangled.org/core .
10
-
run go build -o /usr/bin/knot -ldflags '-s -w -extldflags "-static"' ./cmd/knot
8
+
RUN apk add git gcc musl-dev
9
+
RUN git clone -b ${TAG} https://tangled.org/@tangled.org/core .
10
+
RUN go build -o /usr/bin/knot -ldflags '-s -w -extldflags "-static"' ./cmd/knot
16
-
label org.opencontainers.image.title='knot'
17
-
label org.opencontainers.image.description='data server for tangled'
18
-
label org.opencontainers.image.source='https://tangled.org/@tangled.org/knot-docker'
19
-
label org.opencontainers.image.url='https://tangled.org'
20
-
label org.opencontainers.image.vendor='tangled.org'
21
-
label org.opencontainers.image.licenses='MIT'
16
+
LABEL org.opencontainers.image.title='knot'
17
+
LABEL org.opencontainers.image.description='data server for tangled'
18
+
LABEL org.opencontainers.image.source='https://tangled.org/@tangled.org/knot-docker'
19
+
LABEL org.opencontainers.image.url='https://tangled.org'
20
+
LABEL org.opencontainers.image.vendor='tangled.org'
21
+
LABEL org.opencontainers.image.licenses='MIT'
28
-
run chmod -R 755 /etc/s6-overlay
29
-
run apk add shadow s6-overlay execline openssl openssh git curl bash
30
-
run groupadd -g $GID -f git
31
-
run useradd -u $UID -g $GID -d /home/git git
32
-
run openssl rand -hex 16 | passwd --stdin git
33
-
run mkdir -p /home/git/repositories && chown -R git:git /home/git
34
-
copy --from=builder /usr/bin/knot /usr/bin
35
-
run mkdir /app && chown -R git:git /app
28
+
RUN chmod -R 755 /etc/s6-overlay
29
+
RUN apk add shadow s6-overlay execline openssl openssh git curl bash
30
+
RUN groupadd -g $GID -f git
31
+
RUN useradd -u $UID -g $GID -d /home/git git
32
+
RUN openssl rand -hex 16 | passwd --stdin git
33
+
RUN mkdir -p /home/git/repositories && chown -R git:git /home/git
34
+
COPY --from=builder /usr/bin/knot /usr/bin
35
+
RUN mkdir /app && chown -R git:git /app
37
-
healthcheck --interval=60s --timeout=30s --start-period=5s --retries=3 \
37
+
HEALTHCHECK --interval=60s --timeout=30s --start-period=5s --retries=3 \
cmd curl -f http://localhost:5555 || exit 1
40
-
entrypoint ["/init"]
40
+
ENTRYPOINT ["/init"]