-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
66 lines (53 loc) · 3.1 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
FROM registry.access.redhat.com/ubi8/openjdk-11:1.10-1
#FROM openjdk:14-slim
ARG JMETER_VERSION=5.4.1
ARG JMETER_INSTALLATION_PATH="/opt/jmeter/apache-jmeter-${JMETER_VERSION}"
ARG CURL_OPTS="--connect-timeout 10 --retry 5 --retry-delay 1 --retry-max-time 60"
ARG JMETER_CMD_RUNNER_PATH="${JMETER_INSTALLATION_PATH}/lib/cmdrunner-2.2.jar"
ARG JMETER_CMD_RUNNER_URL="http://search.maven.org/remotecontent?filepath=kg/apc/cmdrunner/2.2/cmdrunner-2.2.jar"
ARG JMETER_PLUGIN_URL="https://jmeter-plugins.org/get/"
ARG JMETER_PLUGIN_PATH="${JMETER_INSTALLATION_PATH}/lib/ext/jmeter-plugin-manager.jar"
## Installing dependencies
#RUN apt-get update && \
# apt-get upgrade -y && \
# apt-get install -y wget coreutils unzip bash curl
USER root
RUN microdnf install -y wget gzip unzip bash curl
# Installing jmeter clean and link
RUN mkdir /opt/jmeter && \
cd /opt/jmeter && \
wget https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-$JMETER_VERSION.tgz && \
tar --extract --gzip --file apache-jmeter-$JMETER_VERSION.tgz && \
rm apache-jmeter-$JMETER_VERSION.tgz && \
rm --recursive --force /var/cache/apk/* && \
rm --recursive --force ${JMETER_INSTALLATION_PATH}/docs
RUN ln --symbolic ${JMETER_INSTALLATION_PATH} /opt/jmeter/apache-jmeter && \
ln --symbolic /proc/1/fd/1 ${JMETER_INSTALLATION_PATH}/bin/jmeter-master.out && \
ln --symbolic /proc/1/fd/1 ${JMETER_INSTALLATION_PATH}/bin/jmeter-master.err && \
ln --symbolic /proc/1/fd/1 ${JMETER_INSTALLATION_PATH}/bin/jmeter-injector.out && \
ln --symbolic /proc/1/fd/1 ${JMETER_INSTALLATION_PATH}/bin/jmeter-injector.err && \
ln --symbolic /proc/1/fd/1 ${JMETER_INSTALLATION_PATH}/bin/jmeter.log && \
ln --symbolic /proc/1/fd/1 ${JMETER_INSTALLATION_PATH}/bin/jmeter-server.log && \
echo "client.tries=3" >> ${JMETER_INSTALLATION_PATH}/bin/jmeter.properties && \
echo "client.retries_delay=20" >> ${JMETER_INSTALLATION_PATH}/bin/jmeter.properties
# Install Plugin cmd runner and jmeter plugin
RUN curl ${CURL_OPTS} --location --output "${JMETER_PLUGIN_PATH}" "${JMETER_PLUGIN_URL}" && \
curl ${CURL_OPTS} --location --output "${JMETER_CMD_RUNNER_PATH}" "${JMETER_CMD_RUNNER_URL}" && \
java -classpath "${JMETER_PLUGIN_PATH}" org.jmeterplugins.repository.PluginManagerCMDInstaller
RUN curl ${CURL_OPTS} --location --output "${JMETER_INSTALLATION_PATH}/lib/jolokia-java-agent.jar" "https://search.maven.org/remotecontent?filepath=org/jolokia/jolokia-jvm/1.6.2/jolokia-jvm-1.6.2-agent.jar"
## Setting users && directory and right
#RUN mkdir /report && \
# addgroup jmeter && \
# adduser --disabled-password --gecos '' --home /jmeter --ingroup jmeter jmeter && \
# chown --recursive jmeter:jmeter /opt/jmeter && \
# chown --recursive jmeter:jmeter /report
ENV JMETER_HOME ${JMETER_INSTALLATION_PATH}
ENV PATH $JMETER_HOME/bin:$PATH
RUN mkdir /report && \
chmod 777 /report && \
chmod -R 777 /opt/jmeter && \
chown --recursive jboss:root /opt/jmeter && \
chown --recursive jboss:root /report
USER jboss
#USER jmeter
#USER jboss