DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Event-Driven Pipelines With Apache Pulsar and Go
  • Scaling Cloud Data Automation: A Practical Guide to Open Table Formats
  • Smart Deployment Strategies for Modern Applications
  • Solving the Mystery: Why Java RSS Grows in Docker on M1 Macs

Trending

  • Implementing Secure API Gateways for Microservices Architecture
  • Implementing Observability in Distributed Systems Using OpenTelemetry
  • 5 Common Security Pitfalls in Serverless Architectures
  • Getting Started With Agentic Workflows in Java and Quarkus
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Testing, Tools, and Frameworks
  4. Introducing a Lightweight Apache JMeter Docker Image

Introducing a Lightweight Apache JMeter Docker Image

Are you looking for a lean, secure, and versatile Docker image for Apache JMeter to streamline your load testing workflows? Look no further!

By 
NaveenKumar Namachivayam user avatar
NaveenKumar Namachivayam
DZone Core CORE ·
Apr. 07, 25 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
5.9K Views

Join the DZone community and get the full member experience.

Join For Free

Are you looking for a lean, secure, and versatile Docker image for Apache JMeter to streamline your load testing of workflows? Look no further! Today, I’m excited to share a new Dockerfile I’ve crafted that delivers a lightweight Apache JMeter image without compromising on functionality. Whether you’re a developer, DevOps engineer, or QA professional, this image is designed to make your performance testing faster, easier, and more efficient.

Why This JMeter Docker Image Stands Out

This isn’t your average JMeter setup. Here’s what makes this Docker image special:

  • Small and secure base: Built on Alpine Linux, known for its tiny footprint and security-first design.
  • Powered by Liberica JDK: Uses bellsoft/liberica-openjdk-alpine, a free, open-source Java runtime optimized for modern deployments.
  • Full JMeter functionality: Includes Apache JMeter for robust load testing, plus a handy script to install plugins as needed.
  • Non-root execution: Runs as the jmeter user for enhanced security — no unnecessary root privileges here.
  • Multi-architecture ready: Supports both amd64 (x86_64) and arm64 platforms, so it works seamlessly on everything from Intel-based servers to Apple M1/M2/M3 chips, AWS Graviton, or even a Raspberry Pi 4.
  • Optimized size: Thanks to multi-stage builds, the image is slim — 51.78 MB compressed and 209.71 MB uncompressed.

This combination of features ensures you get a lightweight, secure, and flexible JMeter environment that’s ready to tackle your testing needs.

Getting Started: Basic Usage

Building and running the image is a breeze. Here’s how to get going:

Clone this repo or simply use docker pull qainsights/jmeter command.

Build the Image

In the directory containing the Dockerfile, run:

Shell
 
docker build -t my-jmeter-image .


This creates an image tagged as my-jmeter-image.

Run JMeter

To execute a test, mount your test directory and specify your .jmx file:

Shell
 
docker run -v /path/to/your/test:/tests my-jmeter-image /tests/your-test.jmx


Replace /path/to/your/test with the local path to your test files and your-test.jmx with your test script’s filename. Done!

Multi-Architecture Support: Flexibility Across Platforms

One of the standout features of this image is its multi-architecture support. Whether you’re running on a traditional x86_64 machine or an ARM64 device like an Apple Silicon Mac or AWS Graviton instance, this image has you covered.

To build a multi-architecture image, use the provided build-multiarch.sh script:

Shell
 
# Make it executable
chmod +x build-multiarch.sh

# Check options
./build-multiarch.sh --help

# Build and push to your registry
./build-multiarch.sh --name jmeter --tag 5.6.3 --registry your-registry/ --push


The script is packed with options:

  • -n, --name: Set the image name (e.g., jmeter).
  • -t, --tag: Specify a version tag (e.g., 5.6.3).
  • -r, --registry: Define your Docker registry.
  • --push: Push the image to your registry after building.

This makes it easy to deploy JMeter across diverse environments without worrying about compatibility.

Advanced Usage: Customize Your Setup

Installing JMeter Plugins

Need specific plugins for your tests? You can add them directly in the Dockerfile. Just tweak the JMETER_PLUGINS argument with a comma-separated list:

Shell
 
ARG JMETER_PLUGINS="jpgc-udp=0.4,jpgc-dummy"


Want a specific version? Use =version-number. Otherwise, it’ll grab the latest.

Keeping It Lean

The image stays lightweight, thanks to some clever optimizations:

  1. Multi-stage builds: Dependencies are separated from the runtime, reducing bloat.
  2. File cleanup: Strips out unnecessary docs and Windows batch files.
  3. Cache management: Clears temporary files and package caches.
  4. Minimal plugins: Only what you need, nothing more.

These steps ensure you’re not hauling around extra weight, making your CI/CD pipelines or local runs faster.

Why Size Matters

At just 151.78 MB compressed, this image is significantly smaller than many JMeter setups, which often balloon past 500 MB. A smaller image means quicker downloads, faster deployments, and less resource overhead — perfect for scaling tests in the cloud or running locally on constrained hardware.

This project is open to contributions. Have an idea to make it even better? Found a bug? Feel free to submit a Pull Request on the repository. Let’s build something awesome together!

Final Thoughts

This lightweight Apache JMeter Docker image is all about efficiency, security, and flexibility. Whether you’re load testing a web app, API, or microservice, it’s got the tools you need in a package that won’t weigh you down. Give it a spin, tweak it to your liking, and let me know how it works for you!

Happy testing!

Apache JMeter Load testing Docker (software) Apache

Published at DZone with permission of NaveenKumar Namachivayam. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Event-Driven Pipelines With Apache Pulsar and Go
  • Scaling Cloud Data Automation: A Practical Guide to Open Table Formats
  • Smart Deployment Strategies for Modern Applications
  • Solving the Mystery: Why Java RSS Grows in Docker on M1 Macs

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook