Skip to content

Commit

Permalink
Use runtime dependency files for each Debian version
Browse files Browse the repository at this point in the history
Generalize dockerfiles by using the runtime dependency files for every
used Debian version.
  • Loading branch information
bjoernricks committed Jan 23, 2025
1 parent a9639aa commit 61e7e8a
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 38 deletions.
24 changes: 6 additions & 18 deletions .docker/prod-oldstable.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,19 @@ ARG DEBIAN_FRONTEND=noninteractive

# Install
COPY . /source
RUN sh /source/.github/install-dependencies.sh /source/.github/build-dependencies.list \
RUN sh /source/.github/install-dependencies.sh \
/source/.github/build-dependencies.list \
&& rm -rf /var/lib/apt/lists/*
RUN cmake -DCMAKE_BUILD_TYPE=Release -DOPENVASD=0 -B/build /source \
&& DESTDIR=/install cmake --build /build -- install
&& DESTDIR=/install cmake --build /build -j$(nproc) -- install

FROM debian:oldstable-slim

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get install -y --no-install-recommends \
libcjson1 \
libgcrypt20 \
libglib2.0-0 \
libgnutls30 \
libgpgme11 \
libhiredis0.14 \
libldap-common \
libnet1 \
libpaho-mqtt1.3 \
libpcap0.8 \
libradcli4 \
libssh-4 \
libuuid1 \
libxml2 \
RUN --mount=type=bind,source=.github,target=/source/ \
sh /source/install-dependencies.sh \
/source/runtime-dependencies.oldstable.list \
&& rm -rf /var/lib/apt/lists/*

COPY --from=build /install/ /
Expand Down
25 changes: 6 additions & 19 deletions .docker/prod-testing.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,19 @@ ARG DEBIAN_FRONTEND=noninteractive

# Install
COPY . /source
RUN sh /source/.github/install-dependencies.sh /source/.github/build-dependencies.list \
RUN sh /source/.github/install-dependencies.sh \
/source/.github/build-dependencies.list \
&& rm -rf /var/lib/apt/lists/*
RUN cmake -DCMAKE_BUILD_TYPE=Release -B/build /source \
&& DESTDIR=/install cmake --build /build -- install
&& DESTDIR=/install cmake --build /build -j$(nproc) -- install

FROM debian:testing-slim

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && \
apt-get install -y --no-install-recommends \
libcjson1 \
libcurl3t64-gnutls \
libgcrypt20 \
libglib2.0-0 \
libgnutls30 \
libgpgme11 \
libhiredis1.1.0 \
libldap-common \
libnet1 \
libpaho-mqtt1.3 \
libpcap0.8 \
libradcli4 \
libssh-4 \
libuuid1 \
libxml2 \
RUN --mount=type=bind,source=.github,target=/source/ \
sh /source/install-dependencies.sh \
/source/runtime-dependencies.testing.list \
&& rm -rf /var/lib/apt/lists/*

COPY --from=build /install/ /
Expand Down
3 changes: 2 additions & 1 deletion .docker/prod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ FROM debian:stable-slim
ARG DEBIAN_FRONTEND=noninteractive

RUN --mount=type=bind,source=.github,target=/source/ \
sh /source/install-dependencies.sh /source/runtime-dependencies.list \
sh /source/install-dependencies.sh \
/source/runtime-dependencies.stable.list \
&& rm -rf /var/lib/apt/lists/*

COPY --from=build /install/ /
Expand Down
14 changes: 14 additions & 0 deletions .github/runtime-dependencies.oldstable.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
libcjson1
libgcrypt20
libglib2.0-0
libgnutls30
libgpgme11
libhiredis0.14
libldap-common
libnet1
libpaho-mqtt1.3
libpcap0.8
libradcli4
libssh-4
libuuid1
libxml2
File renamed without changes.
15 changes: 15 additions & 0 deletions .github/runtime-dependencies.testing.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
libcjson1
libcurl3t64-gnutls
libgcrypt20
libglib2.0-0
libgnutls30
libgpgme11
libhiredis1.1.0
libldap-common
libnet1
libpaho-mqtt1.3
libpcap0.8
libradcli4
libssh-4
libuuid1
libxml2

0 comments on commit 61e7e8a

Please sign in to comment.