Skip to content

Commit 935565d

Browse files
ekoopspoiana
authored andcommitted
fix(images): install correct AWS linux-{headers,tools} on ubuntu
The current installation method for AWS linux headers and tools is based on downloading them from `ports.ubuntu.com` or `archive.ubuntu.com`, and then installing them with `dpkg -i`. Unfortunately, the current implementation doesn't work, because AWS headers are split into two packages: for example, headers for kernel `6.5.0-1024-aws` are split into `linux-headers-6.5.0-1024-aws` and `linux-aws-6.5-headers-6.5.0-1024`; both must be installed in order for anything using headers to work. Fix this headers and tools using directly the package manager. Signed-off-by: Leonardo Di Giovanna <[email protected]>
1 parent a43b69f commit 935565d

File tree

4 files changed

+9
-30
lines changed

4 files changed

+9
-30
lines changed

images/aarch64/ubuntu/6.5/Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
FROM ubuntu:22.04
22

33
ARG VERSION=6.5.0-1024-aws
4-
ARG URL='https://ports.ubuntu.com/ubuntu-ports/pool/main/l/linux-aws-6.5/'
54
ARG CMAKE_VERSION
65

76
# Use bash for all RUN steps with some safety options enabled.
@@ -20,6 +19,8 @@ RUN apt-get update && apt-get install -y \
2019
kmod \
2120
libcap-dev \
2221
libelf-dev \
22+
linux-headers-${VERSION} \
23+
linux-tools-${VERSION} \
2324
llvm \
2425
net-tools \
2526
openssh-server \
@@ -31,13 +32,6 @@ RUN apt-get update && apt-get install -y \
3132
wget && \
3233
apt-get clean && \
3334
rm -rf /var/lib/apt/lists/* && \
34-
curl ${URL} | \
35-
grep -E "linux-headers-${VERSION}|linux-tools-${VERSION}" | \
36-
grep "arm64" | \
37-
cut -d\" -f8 | \
38-
xargs -I@ curl -LO ${URL}@ && \
39-
find . -name '*.deb' | xargs -n1 dpkg -i --force-depends && \
40-
rm -f *.deb && \
4135
CMAKE_ARCH="aarch64" && \
4236
CMAKE_RELEASE_NAME="cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}" && \
4337
curl -L "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_RELEASE_NAME}.tar.gz" | \

images/x86_64/ubuntu/4.15/Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
FROM ubuntu:18.04
22

33
ARG VERSION=4.15.0-1118-aws
4-
ARG URL='https://archive.ubuntu.com/ubuntu/pool/main/l/linux-aws/'
54
ARG CMAKE_VERSION
65

76
# Use bash for all RUN steps with some safety options enabled.
@@ -20,6 +19,8 @@ RUN apt-get update && apt-get install -y \
2019
kmod \
2120
libcap-dev \
2221
libelf-dev \
22+
linux-headers-${VERSION} \
23+
linux-tools-${VERSION} \
2324
llvm \
2425
net-tools \
2526
openssh-server \
@@ -31,13 +32,6 @@ RUN apt-get update && apt-get install -y \
3132
wget && \
3233
apt-get clean && \
3334
rm -rf /var/lib/apt/lists/* && \
34-
curl ${URL} | \
35-
grep -E "linux-headers-${VERSION}|linux-tools-${VERSION}|linux-tools-common_${VERSION}" | \
36-
grep -vE 'i386|lowlatency' | \
37-
cut -d\" -f8 | \
38-
xargs -I@ curl -LO ${URL}@ && \
39-
find . -name '*.deb' | xargs -n1 dpkg -i --force-depends && \
40-
rm -f *.deb && \
4135
CMAKE_ARCH="x86_64" && \
4236
CMAKE_RELEASE_NAME="cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}" && \
4337
curl -L "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_RELEASE_NAME}.tar.gz" | \

images/x86_64/ubuntu/6.2/Dockerfile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
FROM ubuntu:22.04
22

33
ARG VERSION=6.2.0-1018-aws
4-
ARG URL='https://archive.ubuntu.com/ubuntu/pool/main/l/linux-aws-6.2/'
54
ARG CMAKE_VERSION
65

76
# Use bash for all RUN steps with some safety options enabled.
@@ -20,6 +19,8 @@ RUN apt-get update && apt-get install -y \
2019
kmod \
2120
libcap-dev \
2221
libelf-dev \
22+
linux-headers-${VERSION} \
23+
linux-tools-${VERSION} \
2324
llvm \
2425
net-tools \
2526
openssh-server \
@@ -30,12 +31,7 @@ RUN apt-get update && apt-get install -y \
3031
udev \
3132
wget && \
3233
apt-get clean && \
33-
curl ${URL} | \
34-
grep -E "linux-headers-${VERSION}|linux-tools-${VERSION}|linux-tools-common_${VERSION}" | \
35-
cut -d\" -f8 | \
36-
xargs -I@ curl -LO ${URL}@ && \
37-
find . -name '*.deb' | xargs -n1 dpkg -i --force-depends && \
38-
rm -f *.deb && \
34+
rm -rf /var/lib/apt/lists/* && \
3935
CMAKE_ARCH="x86_64" && \
4036
CMAKE_RELEASE_NAME="cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}" && \
4137
curl -L "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_RELEASE_NAME}.tar.gz" | \

images/x86_64/ubuntu/6.5/Dockerfile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
FROM ubuntu:22.04
22

33
ARG VERSION=6.5.0-1024-aws
4-
ARG URL='https://archive.ubuntu.com/ubuntu/pool/main/l/linux-aws-6.5/'
54
ARG CMAKE_VERSION
65

76
# Use bash for all RUN steps with some safety options enabled.
@@ -20,6 +19,8 @@ RUN apt-get update && apt-get install -y \
2019
kmod \
2120
libcap-dev \
2221
libelf-dev \
22+
linux-headers-${VERSION} \
23+
linux-tools-${VERSION} \
2324
llvm \
2425
net-tools \
2526
openssh-server \
@@ -31,12 +32,6 @@ RUN apt-get update && apt-get install -y \
3132
wget && \
3233
apt-get clean && \
3334
rm -rf /var/lib/apt/lists/* && \
34-
curl ${URL} | \
35-
grep -E "linux-headers-${VERSION}|linux-tools-${VERSION}|linux-tools-common_${VERSION}" | \
36-
cut -d\" -f8 | \
37-
xargs -I@ curl -LO ${URL}@ && \
38-
find . -name '*.deb' | xargs -n1 dpkg -i --force-depends && \
39-
rm -f *.deb && \
4035
CMAKE_ARCH="x86_64" && \
4136
CMAKE_RELEASE_NAME="cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}" && \
4237
curl -L "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_RELEASE_NAME}.tar.gz" | \

0 commit comments

Comments
 (0)