-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.oxidized
More file actions
34 lines (26 loc) · 1.7 KB
/
Copy pathDockerfile.oxidized
File metadata and controls
34 lines (26 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# syntax=docker/dockerfile:1.7@sha256:a57df69d0ea827fb7266491f2813635de6f17269be881f696fbfdf2d83dda33e
FROM golang:1.26.5-alpine@sha256:0178a641fbb4858c5f1b48e34bdaabe0350a330a1b1149aabd498d0699ff5fb2 AS tools-build
WORKDIR /src/reporter
COPY oxidized-reporter/go.mod oxidized-reporter/main.go ./
RUN CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /netkeep-oxidized-reporter .
WORKDIR /src/controller
COPY sandbox-controller/go.mod sandbox-controller/main.go ./
RUN CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /netkeep-sandbox-controller .
FROM oxidized/oxidized:0.37.0@sha256:07d8d7d669bb210b1100d121bbe214a3d64d621b1768f8f2179a1508a772541e
USER root
RUN apt-get update \
&& apt-get upgrade -y --no-install-recommends \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /etc/service \
&& ln -s /home/oxidized/.config/oxidized/.ssh /home/oxidized/.ssh \
&& chown -h 30000:30000 /home/oxidized/.ssh
COPY --from=tools-build /netkeep-oxidized-reporter /usr/local/bin/netkeep-oxidized-reporter
COPY --from=tools-build /netkeep-sandbox-controller /usr/local/bin/netkeep-sandbox-controller
LABEL org.opencontainers.image.title="NetKeep Oxidized" \
org.opencontainers.image.authors="Lucas Quaresma <keep@lrq.lat>" \
org.opencontainers.image.source="https://github.com/lrqnet/NetKeep" \
org.opencontainers.image.licenses="AGPL-3.0-only"
USER 30000:30000
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["oxidized"]
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 CMD ["ruby", "-rnet/http", "-e", "u=URI('http://localhost:8888/nodes.json');r=Net::HTTP::Get.new(u);r['Host']='oxidized';exit(Net::HTTP.start(u.host,u.port){|h|h.request(r)}.is_a?(Net::HTTPSuccess) ? 0 : 1)"]