forked from DITAS-Project/pipeline-vdc-base-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.artifact
44 lines (36 loc) · 1.72 KB
/
Dockerfile.artifact
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
34
35
36
37
38
39
40
41
42
43
44
FROM golang:1.10.0-alpine as vdcAgent
RUN apk update && apk add git && \
go get -u github.com/golang/dep/cmd/dep && \
go get github.com/DITAS-Project/VDC-Logging-Agent && \
cd src/github.com/DITAS-Project/VDC-Logging-Agent && \
dep ensure && \
CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags="-s" -o vdc-agent
FROM golang:1.10.0-alpine as vdcThroughput
RUN apk update && apk add git && \
go get -u github.com/golang/dep/cmd/dep && \
go get github.com/DITAS-Project/VDC-Throughput-Agent && \
cd src/github.com/DITAS-Project/VDC-Throughput-Agent && \
dep ensure && \
CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags="-s" -o vdc-traffic
FROM ditas/vdc-request-monitor:latest
# Add compiled vdc-monitoring components
COPY --from=vdcAgent /go/src/github.com/DITAS-Project/VDC-Logging-Agent/vdc-agent /opt/monitoring/vdc-agent
COPY --from=vdcThroughput /go/src/github.com/DITAS-Project/VDC-Throughput-Agent/vdc-traffic /opt/monitoring/vdc-traffic
ENV BUILD_DEPS="gettext alpine-sdk git autoconf automake libtool" \
RUNTIME_DEPS="libintl libpcap-dev ncurses-dev "
# add nassesary command line tools
RUN apk add --update $RUNTIME_DEPS && \
apk add --virtual build_deps $BUILD_DEPS \
&& cd /tmp && git clone https://github.com/dleonard0/pktstat.git \
&& cd pktstat \
&& libtoolize --force && aclocal && autoheader && automake --force-missing --add-missing && autoconf && ./configure \
&& make install && cd ../ rm -rf pktstat \
&& cp /usr/bin/envsubst /usr/local/bin/envsubst \
&& apk del build_deps \
&& rm -rf /var/cache/apk/*
ADD .config /.config
ADD entrypoint.sh /entrypoint.sh
EXPOSE 80
EXPOSE 443
EXPOSE 8484
ENTRYPOINT [ "/entrypoint.sh" ]