Windows Docker Container for Apache JMeter 5.1.1 There are many Linux containers for Apache JMeter is available in Docker and GitHub, but not for Windows. So, I started learning Docker for Windows and created my first container for JMeter for Windows platform. This blog post explains how to leverage Windows Docker file to run Apache JMeter scripts.
How to implement this Windows Docker for Apache JMeter?
This repo helps you to run Apache JMeter in your Windows container. It uses the JMeter 5.1.1 on Windows Server Core with OpenJDK.
If you want to build this image, download this repo and use the below command in docker.
docker build img_from .
How to run JMeter on Windows Container?
First you need to install Docker for Windows. You can use your laptop with Windows 10 Pro or spin up an AWS EC2 instance under free tier. Second, you need compatible Windows version as your base OS. If there is a conflict, you may not be able to run it.
docker pull qainsights/jmeter511 command to pull the image. This will pull the image from Docker Hub.
docker run qainsights/jmeter511 command to run
JMeter inside the container. Below is the sample command which executes
the sample JMeter test plan located in the
docker run qainsights/jmeter511 -n -t .\examples\CSVSample.jmx -l Run1.jtl
To run in interactive mode, use the below command.
docker run -it qainsights/jmeter511 -n -t .\examples\CSVSample.jmx -l Run1.jtl
To remove the container once the execution is completed, use the below command.
docker run -rm qainsights/jmeter511 -n -t .\examples\CSVSample.jmx -l Run1.jtl
If you want to mount your host machine, you can use the below sample command.
docker run -it -v
qainsights/jmeter511 -n -t .\examples\CSVSample.jmx -l
You can keep your JMeter files in your host machine and pass it to the container for execution. Once the execution is done, you can view the log/jtl files in your host machine.
- make sure you are adding
.\in front of the folder names, as the entry point leverages powershell.
- no need to add
jmetercommand, just append
-n -t <yourJMeterTestName>.jmxfile name.