Stop using root in testing containers
[functest-kubernetes.git] / docker / benchmarking / Dockerfile
1 FROM opnfv/functest-kubernetes-smoke
2
3 ARG NETPERF_TAG=master
4 ARG PLOTPERF_TAG=master
5
6 USER root
7 COPY plotperf.py.patch /tmp/plotperf.py.patch
8 RUN apk --no-cache add --update py3-matplotlib && \
9     apk --no-cache add --virtual .build-deps --update patch go && \
10     ln -s /usr/bin/python3 /usr/bin/python && \
11     git clone https://github.com/kubernetes/perf-tests && \
12     (cd perf-tests && git checkout $NETPERF_TAG) && \
13     (cd perf-tests/network/benchmarks/netperf && go build -o /usr/local/bin/launch launch.go) && \
14     curl https://raw.githubusercontent.com/girishkalele/pyplot-docker/$PLOTPERF_TAG/plotperf.py \
15         --output /usr/local/bin/plotperf.py && \
16     (cd /usr/local/bin && patch -p0 < /tmp/plotperf.py.patch && \
17         mv plotperf.py plotperf && chmod a+x plotperf) && \
18     rm -rf perf-tests /tmp/plotperf.py.patch && \
19     apk del .build-deps
20 USER xtesting
21 COPY testcases.yaml /etc/xtesting/testcases.yaml
22 CMD ["run_tests", "-t", "all"]