Skip to content
Docker image for Apache JMeter
Shell Dockerfile
Branch: master
Clone or download

Latest commit

justb4 Merge pull request #25 from tomtom-international/master
feat: Pin alpine 3.10 base image
Latest commit 942c601 Oct 28, 2019


Type Name Latest commit message Commit time
Failed to load latest commit information.
tests/trivial #16 fix SSL Exception from JDK8 by explicitly installing nss lib Mar 22, 2019
.gitignore add reporting and .gitignore Jan 20, 2017
Dockerfile feat: Pin alpine 3.10 Oct 28, 2019
LICENSE Initial commit Jan 19, 2017 Update jmeter version to 5.1.1 Mar 16, 2019 chore: no sudo for docker build command Oct 28, 2019 initial commit Jan 19, 2017 Update with jmeter version to 5.1.1 Mar 16, 2019 add reporting and .gitignore Jan 20, 2017

Docker Build


Image on Docker Hub

Docker image for Apache JMeter. This Docker image can be run as the jmeter command. Find Images of this repo on Docker Hub.


With the script the Docker image can be build from the Dockerfile but this is not really necessary as you may use your own docker build commandline. Or better: use one of the pre-built Images from Docker Hub.

See end of this doc for more detailed build/run/test instructions (thanks to @wilsonmar!)

Build Options

Build argumments (see with default values if not passed to build:

  • JMETER_VERSION - JMeter version, default 5.1.1
  • IMAGE_TIMEZONE - timezone of Docker image, default "Europe/Amsterdam"

NB IMAGE_TIMEZONE setting is not working yet.


The Docker image will accept the same parameters as jmeter itself, assuming you run JMeter non-GUI with -n.

There is a shorthand command. See for an example of how to call

User Defined Variables

This is a standard facility of JMeter: settings in a JMX test script may be defined symbolically and substituted at runtime via the commandline. These are called JMeter User Defined Variables or UDVs.

See and the trivial test plan for an example of UDVs passed to the Docker image via

See also:

Do it for real: detailed build/run/test

Contribution by @wilsonmar

  1. In a Terminal/Command session, install Git, navigate/make a folder, then:

    git clone
    cd docker-jmeter
  2. Run the Build script to download dependencies, including the docker CLI:


    If you view this file, the docker build command within the script is for a specific version of JMeter and implements the Dockerfile in the same folder.

    If you view the Dockerfile, notice the JMETER_VERSION specified is the same as the one in the script. The FROM keyword specifies the Alpine operating system, which is very small (less of an attack surface). Also, no JMeter plug-ins are used.

    At the bottom of the Dockerfile is the file. If you view it, that's where JVM memory settings are specified for jmeter before it is invoked. PROTIP: Such settings need to be adjusted for tests of more complexity.

    The last line in the response should be:

    Successfully tagged justb4/jmeter:5.1.1

  3. Run the test script:


    If you view the script, note it invokes the script file stored at the repo's root. View that file to see that it specifies docker image commands.

    File and folder names specified in the script is reflected in the last line in the response for its run:

    ==== HTML Test Report ====
    See HTML test report in tests/trivial/report/index.html
  4. Switch to your machine's Folder program and navigate to the folder containing files which replaces files cloned in from GitHub:

    cd tests/trivial

    The files are:

    • jmeter.log
    • reports folder (see below)
    • test-plan.jmx containing the JMeter test plan.
    • test-plan.jtl containing statistics from the run displayed by the index.html file.
  5. Navigate into the report folder and open the index.html file to pop up a browser window displaying the run report. On a Mac Terminal:

    cd report
    open index.html

    Here is a sample report:



The Docker image built from the Dockerfile inherits from the Alpine Linux distribution:

"Alpine Linux is built around musl libc and busybox. This makes it smaller and more resource efficient than traditional GNU/Linux distributions. A container requires no more than 8 MB and a minimal installation to disk requires around 130 MB of storage. Not only do you get a fully-fledged Linux environment but a large selection of packages from the repository."

See for Alpine Docker images.

The Docker image will install (via Alpine apk) several required packages most specificly the OpenJDK Java JRE. JMeter is installed by simply downloading/unpacking a .tgz archive from within the Docker image.

A generic is copied into the Docker image and will be the script that is run when the Docker container is run. The simply calls jmeter passing all argumets provided to the Docker container, see script:

sudo docker run --name ${NAME} -i -v ${WORK_DIR}:${WORK_DIR} -w ${WORK_DIR} ${IMAGE} $@


Thanks to and for providing the Dockerfiles that inspired me. @wilsonmar for contributing detailed instructions. Others that tested/reported after version updates.

You can’t perform that action at this time.