Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing ipmctl from default Docker build #3576

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 8 additions & 27 deletions deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.hub.docker.com/library/golang:1.22-alpine3.18 AS build
FROM registry.hub.docker.com/library/golang:1.22-alpine3.20 AS build

# Install build depdencies for all supported arches
RUN apk --no-cache add bash build-base cmake device-mapper findutils git \
Expand All @@ -7,27 +7,14 @@ RUN apk --no-cache add bash build-base cmake device-mapper findutils git \
echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf && \
rm -rf /var/cache/apk/*

RUN wget https://sourceforge.net/projects/perfmon2/files/libpfm4/libpfm-4.11.0.tar.gz && \
echo "112bced9a67d565ff0ce6c2bb90452516d1183e5 libpfm-4.11.0.tar.gz" | sha1sum -c && \
tar -xzf libpfm-4.11.0.tar.gz && \
rm libpfm-4.11.0.tar.gz
RUN wget https://sourceforge.net/projects/perfmon2/files/libpfm4/libpfm-4.13.0.tar.gz && \
echo "bcb52090f02bc7bcb5ac066494cd55bbd5084e65 libpfm-4.13.0.tar.gz" | sha1sum -c && \
tar -xzf libpfm-4.13.0.tar.gz && \
rm libpfm-4.13.0.tar.gz

RUN export DBG="-g -Wall" && \
make -e -C libpfm-4.11.0 && \
make install -C libpfm-4.11.0

# ipmctl only supports Intel x86_64 processors.
# https://github.com/intel/ipmctl/issues/163

# Disable libipmctl due to https://github.com/google/cadvisor/issues/3482
#RUN if [ "$(uname --machine)" = "x86_64" ]; then \
#git clone -b v02.00.00.3885 https://github.com/intel/ipmctl/ && \
#cd ipmctl && \
#mkdir output && \
#cd output && \
#cmake -DRELEASE=ON -DCMAKE_INSTALL_PREFIX=/ -DCMAKE_INSTALL_LIBDIR=/usr/local/lib .. && \
#make -j all && \
#make install; fi
make -e -C libpfm-4.13.0 && \
make install -C libpfm-4.13.0

WORKDIR /go/src/github.com/google/cadvisor

Expand All @@ -43,14 +30,9 @@ ARG VERSION

# libipmctl only works on x86_64 CPUs.
RUN export GO_TAGS="libpfm,netgo"; \
if [ "$(uname --machine)" = "x86_64" ]; then \
# Disable libipmctl due to https://github.com/google/cadvisor/issues/3482
#export GO_TAGS="$GO_TAGS,libipmctl"; \
export GO_TAGS="$GO_TAGS"; \
fi; \
GO_FLAGS="-tags=$GO_TAGS" ./build/build.sh

FROM mirror.gcr.io/library/alpine:3.18
FROM mirror.gcr.io/library/alpine:3.20
MAINTAINER [email protected] [email protected] [email protected] [email protected] [email protected]

RUN apk --no-cache add libc6-compat device-mapper findutils ndctl zfs && \
Expand All @@ -60,7 +42,6 @@ RUN apk --no-cache add libc6-compat device-mapper findutils ndctl zfs && \

# Grab cadvisor,libpfm4 and libipmctl from "build" container if they exist (libipmctl only works on amd64/x86_64).
COPY --from=build /usr/local/lib/libpfm.so* /usr/local/lib/
COPY --from=build /usr/local/lib/libipmctl.so* /usr/local/lib/
COPY --from=build /go/src/github.com/google/cadvisor/_output/cadvisor /usr/bin/cadvisor

EXPOSE 8080
Expand Down
Loading