forked from cloudflare/ebpf_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (20 loc) · 1 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM ubuntu:20.04 as builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get -y --no-install-recommends install build-essential pbuilder aptitude git openssh-client ca-certificates
RUN git clone --branch=v0.18.0 --depth=1 https://github.com/iovisor/bcc.git /root/bcc && \
git -C /root/bcc submodule update --init --recursive
RUN cd /root/bcc && \
/usr/lib/pbuilder/pbuilder-satisfydepends && \
PARALLEL=$(nproc) ./scripts/build-deb.sh release
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -y --no-install-recommends build-essential software-properties-common
RUN add-apt-repository ppa:longsleep/golang-backports && \
apt-get install -y --no-install-recommends golang-1.16-go
ENV PATH="/usr/lib/go-1.16/bin:$PATH"
COPY --from=builder /root/bcc/libbcc_*.deb /tmp/libbcc.deb
RUN dpkg -i /tmp/libbcc.deb
COPY ./ /go/ebpf_exporter
RUN cd /go/ebpf_exporter && GOPATH="" GOPROXY="off" GOFLAGS="-mod=vendor" go install -v ./...