Skip to content

Commit

Permalink
Merge pull request #596 from dropsignal/master
Browse files Browse the repository at this point in the history
rebase docker image to debian 12 (bookworm)
  • Loading branch information
AnalogJ authored Mar 13, 2024
2 parents 5e33c33 + 6a9b89b commit a0f9e6e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
23 changes: 16 additions & 7 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,27 @@ 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
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 \
Expand All @@ -36,17 +41,21 @@ 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 ;; \
"arm64") S6_ARCH=aarch64 ;; \
esac \
&& case ${TARGETARCH} in \
"amd64") S6_ARCH=amd64 ;; \
"arm64") S6_ARCH=aarch64 ;; \
esac \
&& curl https://github.com/just-containers/s6-overlay/releases/download/v${S6VER}/s6-overlay-${S6_ARCH}.tar.gz -L -s --output /tmp/s6-overlay-${S6_ARCH}.tar.gz \
&& 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 /

Expand Down
7 changes: 4 additions & 3 deletions docker/Dockerfile.collector
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@


########
FROM golang:1.20-bullseye as backendbuild
FROM golang:1.20-bookworm as backendbuild

WORKDIR /go/src/github.com/analogj/scrutiny

COPY . /go/src/github.com/analogj/scrutiny

RUN apt-get update && apt-get install -y file && rm -rf /var/lib/apt/lists/*
RUN make binary-clean binary-collector

########
FROM debian:bullseye-slim as runtime
FROM debian:bookworm-slim as runtime
WORKDIR /opt/scrutiny
ENV PATH="/opt/scrutiny/bin:${PATH}"

RUN apt-get update && apt-get install -y cron smartmontools ca-certificates tzdata && update-ca-certificates
RUN apt-get update && apt-get install -y cron smartmontools ca-certificates tzdata && rm -rf /var/lib/apt/lists/* && update-ca-certificates

COPY /docker/entrypoint-collector.sh /entrypoint-collector.sh
COPY /rootfs/etc/cron.d/scrutiny /etc/cron.d/scrutiny
Expand Down
7 changes: 4 additions & 3 deletions docker/Dockerfile.web
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,22 @@ COPY --link . /go/src/github.com/analogj/scrutiny
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 && apt-get install -y 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
EXPOSE 8080
WORKDIR /opt/scrutiny
ENV PATH="/opt/scrutiny/bin:${PATH}"

RUN apt-get update && apt-get install -y ca-certificates curl tzdata && update-ca-certificates
RUN apt-get update && apt-get install -y ca-certificates curl tzdata && rm -rf /var/lib/apt/lists/* && update-ca-certificates

COPY --link --from=backendbuild --chmod=755 /go/src/github.com/analogj/scrutiny/scrutiny /opt/scrutiny/bin/
COPY --link --from=frontendbuild --chmod=644 /go/src/github.com/analogj/scrutiny/dist /opt/scrutiny/web
Expand Down

0 comments on commit a0f9e6e

Please sign in to comment.