Skip to content

Commit

Permalink
docker,drbd: ensure build on all Ubuntu kernels
Browse files Browse the repository at this point in the history
Ubuntu has multiple kernel versions that may use different GCC versions.
In order to install all GCC versions that are needed to build kernel modules,
we can use the "dkms" package. We don't want to install any unnecessary
dependencies, so we parse the dependencies and select all gcc packages.

Signed-off-by: Moritz Wanzenböck <[email protected]>
  • Loading branch information
WanzenBug authored and rck committed Feb 27, 2024
1 parent e5b1453 commit 38a3ec0
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 5 deletions.
16 changes: 14 additions & 2 deletions dockerfiles/drbd-driver-loader/Dockerfile.bionic
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
FROM ubuntu:bionic
MAINTAINER Roland Kammerer <[email protected]>

RUN apt-get update && apt-get upgrade -y && apt-get install -y kmod gnupg wget make gcc patch curl && apt-get clean
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install --no-install-recommends -y \
ca-certificates \
kmod \
gnupg \
wget \
make \
# Ubuntu has multiple kernel versions that may be using different gcc versions: use the dkms package to install them all
$(apt-get install -s dkms | awk '/^Inst gcc/{print $2}') \
patch \
elfutils \
curl && \
apt-get clean

ARG DRBD_VERSION
RUN wget https://pkg.linbit.com/downloads/drbd/9/drbd-${DRBD_VERSION}.tar.gz -O /drbd.tar.gz && \
Expand Down
16 changes: 14 additions & 2 deletions dockerfiles/drbd-driver-loader/Dockerfile.focal
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
FROM ubuntu:focal
MAINTAINER Roland Kammerer <[email protected]>

RUN apt-get update && apt-get upgrade -y && apt-get install -y kmod gnupg wget make gcc patch elfutils curl && apt-get clean
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install --no-install-recommends -y \
ca-certificates \
kmod \
gnupg \
wget \
make \
# Ubuntu has multiple kernel versions that may be using different gcc versions: use the dkms package to install them all
$(apt-get install -s dkms | awk '/^Inst gcc/{print $2}') \
patch \
elfutils \
curl && \
apt-get clean

ARG DRBD_VERSION
RUN wget https://pkg.linbit.com/downloads/drbd/9/drbd-${DRBD_VERSION}.tar.gz -O /drbd.tar.gz && \
Expand Down
15 changes: 14 additions & 1 deletion dockerfiles/drbd-driver-loader/Dockerfile.jammy
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
FROM ubuntu:jammy

RUN apt-get update && apt-get upgrade -y && apt-get install -y kmod gnupg wget make gcc patch elfutils curl && apt-get clean
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install --no-install-recommends -y \
ca-certificates \
kmod \
gnupg \
wget \
make \
# Ubuntu has multiple kernel versions that may be using different gcc versions: use the dkms package to install them all
$(apt-get install -s dkms | awk '/^Inst gcc/{print $2}') \
patch \
elfutils \
curl && \
apt-get clean

ARG DRBD_VERSION
RUN wget https://pkg.linbit.com/downloads/drbd/9/drbd-${DRBD_VERSION}.tar.gz -O /drbd.tar.gz && \
Expand Down

0 comments on commit 38a3ec0

Please sign in to comment.