|
|
|
@ -12,15 +12,19 @@ RUN make binary-frontend
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
######## Build the backend
|
|
|
|
|
FROM golang:1.20-bullseye as backendbuild
|
|
|
|
|
FROM golang:1.20-bookworm as backendbuild
|
|
|
|
|
|
|
|
|
|
WORKDIR /go/src/github.com/analogj/scrutiny
|
|
|
|
|
COPY --link . /go/src/github.com/analogj/scrutiny
|
|
|
|
|
RUN apt-get update && DEBIAN_FRONTEND=noninteractive \
|
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
|
file \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
RUN make binary-clean binary-all WEB_BINARY_NAME=scrutiny
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
######## Combine build artifacts in runtime image
|
|
|
|
|
FROM debian:bullseye-slim as runtime
|
|
|
|
|
FROM debian:bookworm-slim as runtime
|
|
|
|
|
ARG TARGETARCH
|
|
|
|
|
EXPOSE 8080
|
|
|
|
|
WORKDIR /opt/scrutiny
|
|
|
|
@ -28,6 +32,7 @@ ENV PATH="/opt/scrutiny/bin:${PATH}"
|
|
|
|
|
ENV INFLUXD_CONFIG_PATH=/opt/scrutiny/influxdb
|
|
|
|
|
ENV S6VER="1.21.8.0"
|
|
|
|
|
ENV INFLUXVER="2.2.0"
|
|
|
|
|
SHELL ["/usr/bin/sh", "-c"]
|
|
|
|
|
|
|
|
|
|
RUN apt-get update && DEBIAN_FRONTEND=noninteractive \
|
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
@ -36,6 +41,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive \
|
|
|
|
|
curl \
|
|
|
|
|
smartmontools \
|
|
|
|
|
tzdata \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
|
|
|
&& update-ca-certificates \
|
|
|
|
|
&& case ${TARGETARCH} in \
|
|
|
|
|
"amd64") S6_ARCH=amd64 ;; \
|
|
|
|
@ -45,8 +51,11 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive \
|
|
|
|
|
&& tar xzf /tmp/s6-overlay-${S6_ARCH}.tar.gz -C / \
|
|
|
|
|
&& rm -rf /tmp/s6-overlay-${S6_ARCH}.tar.gz \
|
|
|
|
|
&& curl -L https://dl.influxdata.com/influxdb/releases/influxdb2-${INFLUXVER}-${TARGETARCH}.deb --output /tmp/influxdb2-${INFLUXVER}-${TARGETARCH}.deb \
|
|
|
|
|
&& ln -s /usr/bin/false /bin/false \
|
|
|
|
|
&& ln -s /usr/bin/bash /bin/bash \
|
|
|
|
|
&& dpkg -i --force-all /tmp/influxdb2-${INFLUXVER}-${TARGETARCH}.deb \
|
|
|
|
|
&& rm -rf /tmp/influxdb2-2.2.0-${TARGETARCH}.deb
|
|
|
|
|
&& rm -f /bin/bash \
|
|
|
|
|
&& rm -rf /tmp/influxdb2-${INFLUXVER}-${TARGETARCH}.deb
|
|
|
|
|
|
|
|
|
|
COPY /rootfs /
|
|
|
|
|
|
|
|
|
|