Skip to content

Commit 2e1fdbf

Browse files
committed
adding 3.2 and 3.3 support
1 parent 7c5fd10 commit 2e1fdbf

File tree

5 files changed

+199
-1
lines changed

5 files changed

+199
-1
lines changed

jmeter/3.1/Dockerfile

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FROM openjdk:8-alpine
2+
3+
LABEL maintainer="David Sperling <[email protected]>"
4+
5+
ENV JMETER_VERSION apache-jmeter-3.1
6+
ENV JMETER_HOME /opt/$JMETER_VERSION
7+
ENV PATH $JMETER_HOME/bin:$PATH
8+
9+
# overridable environment variables
10+
ENV RESULTS_LOG results.jtl
11+
ENV JMETER_FLAGS=
12+
13+
# Install the required tools for JMeter
14+
RUN apk add --update --no-cache \
15+
curl \
16+
openssh-client \
17+
unzip
18+
19+
WORKDIR /opt
20+
21+
# install JMeter and a few Plugins
22+
RUN curl -O https://archive.apache.org/dist/jmeter/binaries/$JMETER_VERSION.tgz \
23+
&& tar -xvf $JMETER_VERSION.tgz \
24+
&& rm $JMETER_VERSION.tgz \
25+
&& rm -rf $JMETER_VERSION/docs $JMETER_VERSION/printable_docs \
26+
&& curl -O https://jmeter-plugins.org/files/JMeterPlugins-Standard-1.4.0.zip \
27+
-O https://jmeter-plugins.org/files/JMeterPlugins-Extras-1.4.0.zip \
28+
-O https://jmeter-plugins.org/files/JMeterPlugins-ExtrasLibs-1.4.0.zip \
29+
&& unzip -n '*.zip' \
30+
&& rm *.zip
31+
32+
# copy our entrypoint
33+
COPY entrypoint.sh /opt/jmeter/
34+
RUN chmod +x /opt/jmeter/entrypoint.sh
35+
36+
WORKDIR /logs
37+
38+
EXPOSE 1099 50000 51000 4445/udp
39+
40+
# default command in the entrypoint is 'minion'
41+
ENTRYPOINT ["/opt/jmeter/entrypoint.sh"]
42+
CMD ["minion"]

jmeter/3.1/entrypoint.sh

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/sh
2+
#
3+
# Main entrypoint for our Docker image - runs Gru, Minions or other commands
4+
5+
# any .jmx file passed in the command line we act as 'Gru'
6+
if [ ${1##*.} = 'jmx' ]; then
7+
8+
if [ "$MINION_HOSTS" = '' ]; then
9+
echo "MINION_HOSTS must be specified - a command separated list of hostnames or IP addresses"
10+
exit 1
11+
fi
12+
echo "Connecting to $MINION_HOSTS"
13+
14+
# AWS Public HOSTNAME API
15+
echo "Detecting an AWS Environment"
16+
PUBLIC_HOSTNAME=$(curl -s --max-time 5 http://169.254.169.254/latest/meta-data/public-hostname)
17+
18+
if [ "$PUBLIC_HOSTNAME" = '' ]; then
19+
echo "Not running in AWS. Using Gru HOSTNAME $HOSTNAME"
20+
else
21+
HOSTNAME=$PUBLIC_HOSTNAME
22+
echo "Using Gru AWS Public HOSTNAME $HOSTNAME"
23+
fi
24+
# empty the logs directory, or jmeter may fail
25+
rm -rf /logs/report /logs/*.log
26+
# run jmeter in client (gru) mode
27+
exec jmeter -n $JMETER_FLAGS \
28+
-R $MINION_HOSTS \
29+
-Dclient.rmi.localport=51000 \
30+
-Djava.rmi.server.hostname=${PUBLIC_HOSTNAME} \
31+
-l $RESULTS_LOG \
32+
-t $1 \
33+
-e -o /logs/report
34+
35+
fi
36+
37+
# act as a 'Minion'
38+
if [ "$1" = 'minion' ]; then
39+
40+
# AWS Public HOSTNAME API
41+
echo "Detecting an AWS Environment"
42+
PUBLIC_HOSTNAME=$(curl -s --max-time 5 http://169.254.169.254/latest/meta-data/public-hostname)
43+
44+
if [ "$PUBLIC_HOSTNAME" = '' ]; then
45+
echo "Not running in AWS. Using Minion HOSTNAME $HOSTNAME"
46+
else
47+
HOSTNAME=$PUBLIC_HOSTNAME
48+
echo "Using Minion AWS Public HOSTNAME $HOSTNAME"
49+
fi
50+
# run jmeter in server (minion) mode
51+
exec jmeter-server -n \
52+
-Dserver.rmi.localport=50000 \
53+
-Djava.rmi.server.hostname=${HOSTNAME}
54+
55+
fi
56+
57+
exec "$@"

jmeter/3.2/Dockerfile

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FROM openjdk:8-alpine
2+
3+
LABEL maintainer="David Sperling <[email protected]>"
4+
5+
ENV JMETER_VERSION apache-jmeter-3.2
6+
ENV JMETER_HOME /opt/$JMETER_VERSION
7+
ENV PATH $JMETER_HOME/bin:$PATH
8+
9+
# overridable environment variables
10+
ENV RESULTS_LOG results.jtl
11+
ENV JMETER_FLAGS=
12+
13+
# Install the required tools for JMeter
14+
RUN apk add --update --no-cache \
15+
curl \
16+
openssh-client \
17+
unzip
18+
19+
WORKDIR /opt
20+
21+
# install JMeter and a few Plugins
22+
RUN curl -O https://archive.apache.org/dist/jmeter/binaries/$JMETER_VERSION.tgz \
23+
&& tar -xvf $JMETER_VERSION.tgz \
24+
&& rm $JMETER_VERSION.tgz \
25+
&& rm -rf $JMETER_VERSION/docs $JMETER_VERSION/printable_docs \
26+
&& curl -O https://jmeter-plugins.org/files/JMeterPlugins-Standard-1.4.0.zip \
27+
-O https://jmeter-plugins.org/files/JMeterPlugins-Extras-1.4.0.zip \
28+
-O https://jmeter-plugins.org/files/JMeterPlugins-ExtrasLibs-1.4.0.zip \
29+
&& unzip -n '*.zip' \
30+
&& rm *.zip
31+
32+
# copy our entrypoint
33+
COPY entrypoint.sh /opt/jmeter/
34+
RUN chmod +x /opt/jmeter/entrypoint.sh
35+
36+
WORKDIR /logs
37+
38+
EXPOSE 1099 50000 51000 4445/udp
39+
40+
# default command in the entrypoint is 'minion'
41+
ENTRYPOINT ["/opt/jmeter/entrypoint.sh"]
42+
CMD ["minion"]

jmeter/3.2/entrypoint.sh

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/sh
2+
#
3+
# Main entrypoint for our Docker image - runs Gru, Minions or other commands
4+
5+
# any .jmx file passed in the command line we act as 'Gru'
6+
if [ ${1##*.} = 'jmx' ]; then
7+
8+
if [ "$MINION_HOSTS" = '' ]; then
9+
echo "MINION_HOSTS must be specified - a command separated list of hostnames or IP addresses"
10+
exit 1
11+
fi
12+
echo "Connecting to $MINION_HOSTS"
13+
14+
# AWS Public HOSTNAME API
15+
echo "Detecting an AWS Environment"
16+
PUBLIC_HOSTNAME=$(curl -s --max-time 5 http://169.254.169.254/latest/meta-data/public-hostname)
17+
18+
if [ "$PUBLIC_HOSTNAME" = '' ]; then
19+
echo "Not running in AWS. Using Gru HOSTNAME $HOSTNAME"
20+
else
21+
HOSTNAME=$PUBLIC_HOSTNAME
22+
echo "Using Gru AWS Public HOSTNAME $HOSTNAME"
23+
fi
24+
# empty the logs directory, or jmeter may fail
25+
rm -rf /logs/report /logs/*.log
26+
# run jmeter in client (gru) mode
27+
exec jmeter -n $JMETER_FLAGS \
28+
-R $MINION_HOSTS \
29+
-Dclient.rmi.localport=51000 \
30+
-Djava.rmi.server.hostname=${PUBLIC_HOSTNAME} \
31+
-l $RESULTS_LOG \
32+
-t $1 \
33+
-e -o /logs/report
34+
35+
fi
36+
37+
# act as a 'Minion'
38+
if [ "$1" = 'minion' ]; then
39+
40+
# AWS Public HOSTNAME API
41+
echo "Detecting an AWS Environment"
42+
PUBLIC_HOSTNAME=$(curl -s --max-time 5 http://169.254.169.254/latest/meta-data/public-hostname)
43+
44+
if [ "$PUBLIC_HOSTNAME" = '' ]; then
45+
echo "Not running in AWS. Using Minion HOSTNAME $HOSTNAME"
46+
else
47+
HOSTNAME=$PUBLIC_HOSTNAME
48+
echo "Using Minion AWS Public HOSTNAME $HOSTNAME"
49+
fi
50+
# run jmeter in server (minion) mode
51+
exec jmeter-server -n \
52+
-Dserver.rmi.localport=50000 \
53+
-Djava.rmi.server.hostname=${HOSTNAME}
54+
55+
fi
56+
57+
exec "$@"

jmeter/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM openjdk:8-alpine
22

33
LABEL maintainer="David Sperling <[email protected]>"
44

5-
ENV JMETER_VERSION apache-jmeter-3.1
5+
ENV JMETER_VERSION apache-jmeter-3.3
66
ENV JMETER_HOME /opt/$JMETER_VERSION
77
ENV PATH $JMETER_HOME/bin:$PATH
88

0 commit comments

Comments
 (0)