diff --git a/deploy/Dockerfile b/deploy/Dockerfile index 80b4162d82..e7346fa780 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:3.12 AS build -RUN apk --no-cache add libc6-compat device-mapper findutils zfs build-base linux-headers go bash git wget && \ +RUN apk --no-cache add libc6-compat device-mapper findutils zfs build-base linux-headers go bash git wget cmake pkgconfig ndctl-dev && \ apk --no-cache add thin-provisioning-tools --repository http://dl-3.alpinelinux.org/alpine/edge/main/ && \ echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf && \ rm -rf /var/cache/apk/* @@ -14,25 +14,34 @@ RUN export DBG="-g -Wall" && \ make -e -C libpfm-4.11.0 && \ make install -C libpfm-4.11.0 +RUN git clone -b v02.00.00.3820 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 + ADD . /go/src/github.com/google/cadvisor WORKDIR /go/src/github.com/google/cadvisor ENV GOROOT /usr/lib/go ENV GOPATH /go -ENV GO_FLAGS="-tags=libpfm,netgo" -RUN ./build/build.sh +ENV GO_FLAGS="-tags=libpfm,netgo,libipmctl" +RUN ./build/build.sh FROM alpine:3.12 MAINTAINER dengnan@google.com vmarmol@google.com vishnuk@google.com jimmidyson@gmail.com stclair@google.com -RUN apk --no-cache add libc6-compat device-mapper findutils zfs && \ +RUN apk --no-cache add libc6-compat device-mapper findutils zfs ndctl && \ apk --no-cache add thin-provisioning-tools --repository http://dl-3.alpinelinux.org/alpine/edge/main/ && \ echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf && \ rm -rf /var/cache/apk/* -# Grab cadvisor and libpfm4 from "build" container. +# Grab cadvisor,libpfm4 and libipmctl from "build" container. 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/cadvisor /usr/bin/cadvisor EXPOSE 8080 diff --git a/docs/development/build.md b/docs/development/build.md index fe7e016711..a010efbacc 100644 --- a/docs/development/build.md +++ b/docs/development/build.md @@ -36,7 +36,7 @@ cAdvisor can be linked against [libipmctl](https://github.com/intel/ipmctl) libr * `libipmctl-devel` must be installed on build system. * `libipmctl` must be installed on all systems where cAdvisor is running. -Detailed information about building `libipmctl` can be found in the project's [README](https://github.com/intel/ipmctl#build). Make sure to use the most up to date released version. Functionality that relies on `libipmctl` was tested against version 02.00.00.3719 of the library. +Detailed information about building `libipmctl` can be found in the project's [README](https://github.com/intel/ipmctl#build). Make sure to use the most up to date released version. Functionality that relies on `libipmctl` was tested against version 02.00.00.3820 of the library. To enable `libipmctl` support `GO_FLAGS` variable must be set: