Skip to content

Commit 3e6708d

Browse files
Change to alpine
1 parent fd6fdea commit 3e6708d

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

Dockerfile.consumer

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# ---------- Build stage ----------
2-
FROM debian:bookworm AS build
2+
FROM alpine:3.22.1 AS build
33
ARG CMAKE_BUILD_TYPE=Release
44

5-
RUN apt-get update && apt-get install -y --no-install-recommends \
6-
build-essential cmake pkg-config git ca-certificates \
7-
&& rm -rf /var/lib/apt/lists/*
5+
# Install dependencies
6+
RUN apk add --no-cache \
7+
build-base \
8+
cmake \
9+
git \
10+
pkgconfig \
11+
ca-certificates
812

913
WORKDIR /src
1014
COPY heidpi-logger/ ./heidpi-logger/
@@ -19,21 +23,22 @@ RUN cmake -S heidpi-logger -B /build \
1923
&& strip /build/heidpi_cpp || true
2024

2125
# ---------- Runtime stage ----------
22-
FROM debian:bookworm-slim AS runtime
26+
FROM alpine:3.22.1 AS runtime
2327

24-
RUN apt-get update && apt-get install -y --no-install-recommends \
25-
libstdc++6 ca-certificates \
26-
&& rm -rf /var/lib/apt/lists/*
28+
# Install runtime dependencies
29+
RUN apk add --no-cache \
30+
libstdc++ \
31+
ca-certificates
2732

28-
# non-root
29-
RUN useradd -r -u 10001 appuser
33+
# Create non-root user
34+
RUN adduser -D -u 10001 appuser
3035
WORKDIR /app
3136

32-
# Configs (aus Repo-Root)
37+
# Copy configuration and built binary
3338
COPY config.yml /app/config.yml
34-
3539
COPY --from=build /build/heidpi_cpp /usr/local/bin/app
3640

41+
# Environment variables
3742
ENV WRITE="/var/log" \
3843
SHOW_FLOW_EVENTS=1 \
3944
SHOW_PACKET_EVENTS=1 \

0 commit comments

Comments
 (0)