The issue is Container stopped after docker completing the Jmeter hit.
Docker File last Line :
- CMD jmeter -n -t Get_Ping_Node_API.jmx -l .csv -e -o Get_Ping_Node_API2.html
Running:
ubuntu@ubuntu:~/sumit/docker-jmeter$ docker exec -it 3f2092a9895d bash Error response from daemon: Container 3f2092a9895d881b97459af9f9c7982e06c696d1b0d4dc1484ee9dd75a3368ee is not running ubuntu@ubuntu:~/sumit/docker-jmeter$
You're misinterpreting command line options:
As per this documentation:
Parameter following -o should be a folder, you have put a file, it should be:
-o OUTPUT_FOLDER
Parameter following -l should be a csv file, you have put .csv which is only a suffix
It should be:
-l results.csv
Your JMeter execution line is not very correct, you should amend it like:
CMD jmeter -n -t Get_Ping_Node_API.jmx -l result .csv -e -o Get_Ping_Node_API2
-l
command line argument assumes file where results will be stored, you cannot leave the filename empty -o
command-line argument assumes folder where the dashboard will be generated, you should remove .html extension from it References:
Example Dockerfile you can use as a basis, it executes Test.jmx
file from JMeter's "extras" folder, feel free to amend it as required to kick off your own test plan:
# 1
FROM alpine:3.6
# 2
LABEL maintainer=”vincenzo.marrazzo@domain.personal>
# 3
ARG JMETER_VERSION="4.0"
# 4
ENV JMETER_HOME /opt/apache-jmeter-${JMETER_VERSION}
ENV JMETER_BIN ${JMETER_HOME}/bin
ENV MIRROR_HOST http://mirrors.ocf.berkeley.edu/apache/jmeter
ENV JMETER_DOWNLOAD_URL ${MIRROR_HOST}/binaries/apache-jmeter-${JMETER_VERSION}.tgz
ENV JMETER_PLUGINS_DOWNLOAD_URL http://repo1.maven.org/maven2/kg/apc
ENV JMETER_PLUGINS_FOLDER ${JMETER_HOME}/lib/ext/
# 5
RUN apk update \
&& apk upgrade \
&& apk add ca-certificates \
&& update-ca-certificates \
&& apk add --update openjdk8-jre tzdata curl unzip bash \
&& cp /usr/share/zoneinfo/Europe/Rome /etc/localtime \
&& echo "Europe/Rome" > /etc/timezone \
&& rm -rf /var/cache/apk/* \
&& mkdir -p /tmp/dependencies \
&& curl -L --silent ${JMETER_DOWNLOAD_URL} > /tmp/dependencies/apache-jmeter-${JMETER_VERSION}.tgz \
&& mkdir -p /opt \
&& tar -xzf /tmp/dependencies/apache-jmeter-${JMETER_VERSION}.tgz -C /opt \
&& rm -rf /tmp/dependencies
# 6
RUN curl -L --silent ${JMETER_PLUGINS_DOWNLOAD_URL}/jmeter-plugins-dummy/0.2/jmeter-plugins-dummy-0.2.jar -o ${JMETER_PLUGINS_FOLDER}/jmeter-plugins-dummy-0.2.jar
RUN curl -L --silent ${JMETER_PLUGINS_DOWNLOAD_URL}/jmeter-plugins-cmn-jmeter/0.5/jmeter-plugins-cmn-jmeter-0.5.jar -o ${JMETER_PLUGINS_FOLDER}/jmeter-plugins-cmn-jmeter-0.5.jar
# 7
ENV PATH $PATH:$JMETER_BIN
#8
WORKDIR ${JMETER_BIN}
#9
CMD ./jmeter -n -t ../extras/Test.jmx -l result.jtl -e -o Get_Ping_Node_API2
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.