forked from pruivo/IspnPerfTest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (29 loc) · 1.51 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
## The first stage is used to git-clone and build JGroups; this requires a JDK/javac/git/ant
FROM adoptopenjdk/openjdk11 as build1
RUN apt-get update ; apt-get install -y git maven net-tools netcat iputils-ping dnsutils
FROM build1 as build2
## Download and build JGroups src code
RUN git clone https://github.com/belaban/IspnPerfTest.git
RUN cd IspnPerfTest ; mvn -DskipTests=true package dependency:copy-dependencies
# For the runtime, we only need a JRE (smaller footprint)
FROM adoptopenjdk/openjdk11:jre as setup-stage
LABEL maintainer="Bela Ban ([email protected])"
RUN useradd --uid 1000 --home /opt/ispn --create-home --shell /bin/bash ispn
RUN echo root:root | chpasswd ; echo ispn:ispn | chpasswd
RUN printf "\nispn ALL=(ALL) NOPASSWD: ALL\n" >> /etc/sudoers
# EXPOSE 7800-7900:7800-7900 9000-9100:9000-9100
ENV HOME /opt/ispn
ENV PATH $PATH:$HOME/IspnPerfTest/bin
WORKDIR /opt/ispn
COPY --from=build2 /IspnPerfTest /opt/ispn/IspnPerfTest
COPY --from=build2 /bin/ping /bin/netstat /bin/nc /bin/
COPY --from=build2 /sbin/ifconfig /sbin/
COPY --from=build2 /usr/bin/dig /usr/bin/nslookup /usr/bin/
COPY --from=build2 /lib/x86_64-linux-gnu/lib* /lib/x86_64-linux-gnu/
COPY --from=build2 /usr/lib/x86_64-linux-gnu/lib* /usr/lib/x86_64-linux-gnu/
RUN chown -R ispn.ispn $HOME/*
# Run everything below as the ispn user. Unfortunately, USER is only observed by RUN, *not* by ADD or COPY !!
USER ispn
RUN chmod u+x $HOME/*
#CMD clear && cat $HOME/IspnPerfTest/README && /bin/bash
CMD exec $HOME/IspnPerfTest/bin/perf-test.sh -nohup $*