Sign inSign up

whindes/jmeter

By whindes

•Updated almost 9 years ago

Run JMeter in a Linux (Alpine) docker container.

Image
1

225

whindes/jmeter repository overview

⁠docker-jmeter

⁠Source - Github

Github - whindes/docker-jmeter⁠

Docker image for Apache JMeter⁠. The aim is to have a Docker image that can be run as the jmeter command itself.

⁠Building

With the script build.sh⁠ the Docker image can be build from the Dockerfile⁠ but this is not really necessary as you may use your own docker build commandline.

⁠Build Options

Build argumments (see build.sh⁠) with default values if not passed to build:

  • JMETER_VERSION - JMeter version, default 3.3
  • IMAGE_TIMEZONE - timezone of Docker image, default "US/Pacific"

NB IMAGE_TIMEZONE setting is not working yet.

⁠Running

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

There is a shorthand run.sh⁠ command. See test.sh⁠ for an example of how to call run.sh⁠.

⁠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 test.sh⁠ and the trivial test plan⁠ for an example of UDVs passed to the Docker image via run.sh⁠.

See also: http://blog.novatec-gmbh.de/how-to-pass-command-line-properties-to-a-jmeter-testplan/⁠

⁠Specifics

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 https://hub.docker.com/_/alpine/⁠ 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 http://mirror.serversupportforum.de/apache/jmeter/binaries⁠ within the Docker image.

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

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

⁠Credits

Thanks to https://github.com/hauptmedia/docker-jmeter⁠ and https://github.com/hhcordero/docker-jmeter-server⁠ Just van den Broecke for providing the Dockerfiles and the ability to Fork this repo - https://github.com/justb4/docker-jmeter⁠.

Tag summary

Content type

Image

Digest

Size

106.7 MB

Last updated

almost 9 years ago

docker pull whindes/jmeter