-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathDockerfile_jmeter
53 lines (43 loc) · 1.91 KB
/
Dockerfile_jmeter
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
53
#
# Copyright (c) 2020, 2020 IBM Corporation, RedHat and others.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Dockerfile to build a jmeter container able to drive petclinic
# Results appear on /output in the container
# Must specify the hostname for the petclinic application (or localhost will be assumed)
FROM adoptopenjdk:8-jre-hotspot
ENV JMETER_VERSION 3.3
# Install pre-requisite packages
RUN apt-get update && apt-get install -y --no-install-recommends wget unzip \
&& rm -rf /var/lib/apt/lists/*
# Install jmeter
RUN mkdir /jmeter \
&& mkdir /output \
&& cd /jmeter/ \
&& wget https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-$JMETER_VERSION.tgz \
&& tar -xzf apache-jmeter-$JMETER_VERSION.tgz \
&& rm apache-jmeter-$JMETER_VERSION.tgz
# Set jmeter home
ENV JMETER_HOME /jmeter/apache-jmeter-$JMETER_VERSION
# Add jmeter to the PATH
ENV PATH $JMETER_HOME/bin:$PATH
# We should set summariser.interval=6 in bin/jmeter.properties
RUN echo 'summariser.interval=6' >> $JMETER_HOME/bin/jmeter.properties
# Copy the script to be executed and other needed files
COPY jmeter-driver/petclinic.jmx $JMETER_HOME/petclinic.jmx
COPY jmeter-driver/applyLoad.sh $JMETER_HOME/bin/applyLoad.sh
RUN chmod u+x $JMETER_HOME/bin/applyLoad.sh
# Environment variables that we want the user to redefine
ENV JHOST=localhost JPORT=32334 JUSERS=15 JDURATION=60
ENTRYPOINT ["applyLoad.sh"]