forked from leannetworking/ovs-exporter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
33 lines (20 loc) · 764 Bytes
/
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
FROM alpine:3.9 as ovsbuild
# Install openvswitch to get the ovs-ofctl binary
RUN apk add --update --no-cache openvswitch
FROM golang:1.12-alpine3.9 as gobuild
RUN apk add --update --no-cache git make
#add the working directory
ADD . /root/go/src/github.com/biwwy0/ovs-exporter
ENV GOPATH=/root/go
#build the GO binary
RUN cd /root/go/src/github.com/biwwy0/ovs-exporter \
&& make build
FROM alpine:3.9
MAINTAINER "LeanNet" <[email protected]>
#add ovs-ofctl dependecies
RUN apk add --update --no-cache libcap-ng libssl1.1
#copy the ovs-ofctl binary
COPY --from=ovsbuild /usr/bin/ovs-ofctl /usr/bin/ovs-ofctl
#copy the complied ovs-exporter binary
COPY --from=gobuild /root/go/src/github.com/biwwy0/ovs-exporter ./
ENTRYPOINT ["./bin/ovs-exporter"]