Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rebase docker image to debian 12 (bookworm) #596

Merged
merged 3 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,26 @@ 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
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"]
AnalogJ marked this conversation as resolved.
Show resolved Hide resolved

RUN apt-get update && DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
Expand All @@ -36,17 +40,20 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive \
curl \
smartmontools \
tzdata \
&& update-ca-certificates \
&& case ${TARGETARCH} in \
"amd64") S6_ARCH=amd64 ;; \
"arm64") S6_ARCH=aarch64 ;; \
esac \
&& update-ca-certificates
RUN case ${TARGETARCH} in \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason you wanted to split up this RUN into multiple steps?
Is this a leftover from debugging?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I was trying to figure out if it was the apt command or curl command causing the problem. It can be combined into a single line again.

"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 \
&& rm -rf /tmp/s6-overlay-${S6_ARCH}.tar.gz
RUN 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 \
AnalogJ marked this conversation as resolved.
Show resolved Hide resolved
&& 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
AnalogJ marked this conversation as resolved.
Show resolved Hide resolved

COPY /rootfs /

Expand Down
5 changes: 3 additions & 2 deletions docker/Dockerfile.collector
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@


########
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
AnalogJ marked this conversation as resolved.
Show resolved Hide resolved
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}"

Expand Down
5 changes: 3 additions & 2 deletions docker/Dockerfile.web
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ 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
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}"
Expand Down