Skip to content

Commit

Permalink
Add libipmctl to docker image.
Browse files Browse the repository at this point in the history
Signed-off-by: Paweł Szulik <pawel.szulik@intel.com>
  • Loading branch information
Paweł Szulik committed Jan 22, 2021
1 parent c09d1ab commit 5ff76c2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
19 changes: 14 additions & 5 deletions deploy/Dockerfile
Original file line number Diff line number Diff line change
@@ -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/*
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/development/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit 5ff76c2

Please sign in to comment.