forked from redhat-best-practices-for-k8s/l2discovery-lib
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
18 lines (17 loc) · 739 Bytes
/
Dockerfile
File metadata and controls
18 lines (17 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
FROM registry.access.redhat.com/ubi9/ubi:9.4-1214.1726694543
RUN dnf -y --disableplugin=subscription-manager install iputils iproute ethtool pciutils
RUN dnf -y --disableplugin=subscription-manager remove python3-setuptools
COPY l2discovery-linux-amd64 /usr/bin
COPY l2discovery-linux-arm64 /usr/bin
RUN \
if [ "$(uname -m)" = x86_64 ]; then \
echo "Detected x86_64 CPU architecture."; \
mv /usr/bin/l2discovery-linux-amd64 /usr/bin/l2discovery; \
elif [ "$(uname -m)" = aarch64 ]; then \
echo "Detected aarch64 CPU architecture."; \
mv /usr/bin/l2discovery-linux-arm64 /usr/bin/l2discovery; \
else \
echo "CPU architecture is not supported." && exit 1; \
fi
USER 0
CMD ["/bin/sh", "-c", "/usr/bin/l2discovery"]