Skip to content

Commit 590e56b

Browse files
committed
fix: Handle libpod rootless containers, use sqlite as the source of info
Before this change, we were using `podman inspect` command to get information about libpod containers. But since Pulsar is running as root, using CLI is not going to show any information about rootless containers. This is fixed by using sqlite (which is used internally by libpod) and `images.json` file to resolve all necessary information about containers. To handle rootless containers gracefully, we check whether any user with their own home directory has a libpod database.
1 parent 458a5e6 commit 590e56b

17 files changed

+452
-192
lines changed
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
FROM ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main
22
RUN dpkg --add-architecture arm64 && \
3-
ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime && echo Europe/Rome > /etc/timezone && \
4-
apt update && apt install -y lsb-release wget software-properties-common gnupg libssl-dev:arm64 && \
5-
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 && \
6-
ln -s /usr/bin/clang-17 /usr/bin/clang && \
7-
ln -s /usr/bin/llvm-strip-17 /usr/bin/llvm-strip
3+
ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime && echo Europe/Rome > /etc/timezone \
4+
&& apt update \
5+
&& apt install -y \
6+
lsb-release
7+
wget
8+
software-properties-common
9+
gnupg
10+
libssl-dev:arm64 \
11+
libsqlite3-dev:arm64 \
12+
&& wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 \
13+
&& ln -s /usr/bin/clang-17 /usr/bin/clang \
14+
&& ln -s /usr/bin/llvm-strip-17 /usr/bin/llvm-strip
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
FROM ghcr.io/cross-rs/aarch64-unknown-linux-musl:main
22
RUN dpkg --add-architecture arm64 && \
3-
ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime && echo Europe/Rome > /etc/timezone && \
4-
apt update && apt install -y lsb-release wget software-properties-common gnupg libssl-dev:arm64 && \
5-
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 && \
6-
ln -s /usr/bin/clang-17 /usr/bin/clang && \
7-
ln -s /usr/bin/llvm-strip-17 /usr/bin/llvm-strip
3+
ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime && echo Europe/Rome > /etc/timezone \
4+
&& apt update \
5+
&& apt install -y \
6+
lsb-release \
7+
wget \
8+
software-properties-common \
9+
gnupg \
10+
libssl-dev:arm64 \
11+
libsqlite3-dev:arm64 \
12+
&& wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 \
13+
&& ln -s /usr/bin/clang-17 /usr/bin/clang \
14+
&& ln -s /usr/bin/llvm-strip-17 /usr/bin/llvm-strip
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
FROM ghcr.io/cross-rs/riscv64gc-unknown-linux-gnu:main
22
RUN dpkg --add-architecture riscv64 && \
3-
ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime && echo Europe/Rome > /etc/timezone && \
4-
apt update && apt install -y lsb-release wget software-properties-common gnupg libssl-dev:riscv64 && \
5-
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 && \
6-
ln -s /usr/bin/clang-17 /usr/bin/clang && \
7-
ln -s /usr/bin/llvm-strip-17 /usr/bin/llvm-strip
3+
ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime && echo Europe/Rome > /etc/timezone \
4+
&& apt update \
5+
&& apt install -y \
6+
lsb-release \
7+
wget \
8+
software-properties-common \
9+
gnupg \
10+
libssl-dev:riscv64 \
11+
libsqlite3-dev:riscv64 \
12+
&& wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 \
13+
&& ln -s /usr/bin/clang-17 /usr/bin/clang \
14+
&& ln -s /usr/bin/llvm-strip-17 /usr/bin/llvm-strip
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
FROM ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main
2-
RUN ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime && echo Europe/Rome > /etc/timezone && \
3-
apt update && apt install -y lsb-release wget software-properties-common gnupg libssl-dev && \
4-
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 && \
5-
ln -s /usr/bin/clang-17 /usr/bin/clang && \
6-
ln -s /usr/bin/llvm-strip-17 /usr/bin/llvm-strip
2+
RUN ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime && echo Europe/Rome > /etc/timezone \
3+
&& apt update \
4+
&& apt install -y \
5+
lsb-release \
6+
wget \
7+
software-properties-common \
8+
gnupg \
9+
libssl-dev \
10+
libsqlite3-dev \
11+
&& wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 \
12+
&& ln -s /usr/bin/clang-17 /usr/bin/clang \
13+
&& ln -s /usr/bin/llvm-strip-17 /usr/bin/llvm-strip
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
FROM ghcr.io/cross-rs/x86_64-unknown-linux-musl:main
2-
RUN ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime && echo Europe/Rome > /etc/timezone && \
3-
apt update && apt install -y lsb-release wget software-properties-common gnupg libssl-dev && \
4-
wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 && \
5-
ln -s /usr/bin/clang-17 /usr/bin/clang && \
6-
ln -s /usr/bin/llvm-strip-17 /usr/bin/llvm-strip
2+
RUN ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime && echo Europe/Rome > /etc/timezone \
3+
&& apt update \
4+
&& apt install -y \
5+
lsb-release \
6+
wget \
7+
software-properties-common \
8+
gnupg \
9+
libssl-dev \
10+
libsqlite3-dev \
11+
&& wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 17 \
12+
&& ln -s /usr/bin/clang-17 /usr/bin/clang \
13+
&& ln -s /usr/bin/llvm-strip-17 /usr/bin/llvm-strip

Cargo.lock

Lines changed: 87 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ chrono = { version = "0.4.31" }
109109
clap = { version = "4.4.11", features = ["derive"] }
110110
comfy-table = "7.1.0"
111111
dns-parser = "0.8.0"
112+
diesel = { version = "2.1", features = ["sqlite"] }
112113
env_logger = "0.10.1"
113114
futures = "0.3.29"
114115
futures-util = "0.3.29"

crates/bpf-common/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ serde = { workspace = true }
3232
serde_json = { workspace = true }
3333
lazy_static = { workspace = true }
3434
regex = { workspace = true }
35+
diesel = { workspace = true }
3536

3637
# Test deps
3738
which = { workspace = true, optional = true }

0 commit comments

Comments
 (0)