-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
52 lines (41 loc) · 1.67 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM alpine:3.7 as netperfbuild
# Install dependencies for netperf compile
RUN apk add --update --no-cache g++ make curl perl linux-headers
# Download and install NetPerf
RUN curl -LO https://github.com/HewlettPackard/netperf/archive/netperf-2.7.0.tar.gz \
&& tar -xzf netperf-2.7.0.tar.gz \
&& mv netperf-netperf-2.7.0/ netperf-2.7.0
RUN cd netperf-2.7.0 && ./configure \
&& make && make install
# Download and install wrk
RUN curl -OL curl -OL https://github.com/wg/wrk/archive/refs/tags/4.2.0.tar.gz \
&& tar -xzf 4.2.0.tar.gz \
&& mv wrk-4.2.0 wrk
RUN cd wrk && make && mv wrk /usr/local/bin
FROM fortio/fortio:1.3.0 as fortiobuild
FROM alpine:3.7
# This is a mixed container of NetPerf and Iperf for Kubernetes network performance testing
MAINTAINER [email protected]
RUN apk update
RUN apk add busybox-extras curl tcpdump
# Intall iperf using apk and clean the cache
RUN apk add --no-cache iperf iputils
# Copy netperf binarias from the built image
COPY --from=netperfbuild /usr/local/bin/netperf /usr/local/bin/netperf
COPY --from=netperfbuild /usr/local/bin/netserver /usr/local/bin/netserver
COPY --from=netperfbuild /usr/local/bin/wrk /usr/local/bin/wrk
# Copy the fortio binaries and files
COPY --from=fortiobuild /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=fortiobuild /usr/share/fortio/static /usr/share/fortio/static
COPY --from=fortiobuild /usr/share/fortio/templates /usr/share/fortio/templates
COPY --from=fortiobuild /usr/bin/fortio /usr/bin/fortio
# Copy the minimal start scprit
COPY run.sh ./
RUN chmod 744 run.sh
EXPOSE 5001/udp
EXPOSE 5001/tcp
EXPOSE 8079/tcp
EXPOSE 8080/tcp
EXPOSE 8081/tcp
EXPOSE 12865/tcp
ENTRYPOINT ["./run.sh"]