├── Dockerfile ├── LICENSE ├── README.md ├── alpine ├── Dockerfile ├── dependencies │ ├── JMeterPlugins-Extras-1.3.0.zip │ ├── JMeterPlugins-ExtrasLibs-1.3.0.zip │ ├── JMeterPlugins-Standard-1.3.0.zip │ └── apache-jmeter-2.13.tgz └── docker-entrypoint.sh ├── dependencies ├── JMeterPlugins-Extras-1.3.0.zip ├── JMeterPlugins-ExtrasLibs-1.3.0.zip ├── JMeterPlugins-Standard-1.3.0.zip └── apache-jmeter-2.13.tgz └── docker-entrypoint.sh /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:14.04 2 | 3 | MAINTAINER Hector Cordero 4 | 5 | ENV JMETER_VERSION 2.13 6 | ENV JMETER_HOME /usr/local/apache-jmeter-${JMETER_VERSION} 7 | ENV JMETER_BIN $JMETER_HOME/bin 8 | ENV IP 127.0.0.1 9 | ENV RMI_PORT 1099 10 | 11 | RUN apt-get -qq update && \ 12 | apt-get -yqq install openjdk-7-jre-headless unzip && \ 13 | apt-get -q clean && \ 14 | rm -rf /var/lib/apt/lists/* 15 | 16 | COPY dependencies /tmp/dependencies 17 | 18 | RUN tar -xzf /tmp/dependencies/apache-jmeter-${JMETER_VERSION}.tgz -C /usr/local && \ 19 | unzip -oq "/tmp/dependencies/JMeterPlugins-*.zip" -d $JMETER_HOME && \ 20 | apt-get -yqq purge unzip && \ 21 | apt-get -yqq autoremove && \ 22 | rm -rf /tmp/dependencies 23 | 24 | ENV PATH $PATH:$JMETER_BIN 25 | 26 | WORKDIR $JMETER_HOME 27 | 28 | EXPOSE $RMI_PORT 29 | 30 | COPY docker-entrypoint.sh / 31 | 32 | ENTRYPOINT ["/docker-entrypoint.sh"] 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Hector Cordero 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JMeter in Server Mode 2 | 3 | [![](https://badge.imagelayers.io/hhcordero/docker-jmeter-server:latest.svg)](https://imagelayers.io/?images=hhcordero/docker-jmeter-server:latest 'Get your own badge on imagelayers.io') 4 | 5 | ### Supported Tags 6 | 7 | - [`latest`](https://github.com/hhcordero/docker-jmeter-server/tree/master/alpine) 8 | - [`alpine`](https://github.com/hhcordero/docker-jmeter-server/tree/master/alpine) 9 | - [`ubuntu`](https://github.com/hhcordero/docker-jmeter-server) 10 | 11 | Docker image for JMeter in server mode running Minimal Alpine Linux or Ubuntu. Make sure to open port 1099. You also need the public ip (see environment variable 'IP' below). 12 | 13 | ### Usage 14 | 15 | On cli, execute the following: 16 | 17 | ```sh 18 | $ docker run \ 19 | --detach \ 20 | --publish 1099:1099 \ 21 | --env IP=[IP] \ 22 | hhcordero/docker-jmeter-server 23 | ``` 24 | 25 | ### Helper script 26 | 27 | [Dockerized JMeter - A Distributed Load Testing Workflow](https://gist.github.com/hhcordero/abd1dcaf6654cfe51d0b) 28 | 29 | This is a shell script that make use of [Docker Machine](https://github.com/docker/machine) to provision VM. Currently supported clouds are: 30 | - Amazon 31 | - DigitalOcean 32 | 33 | -------------------------------------------------------------------------------- /alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.2 2 | 3 | MAINTAINER Hector Cordero 4 | 5 | ENV JMETER_VERSION 2.13 6 | ENV JMETER_HOME /usr/local/apache-jmeter-${JMETER_VERSION} 7 | ENV JMETER_BIN $JMETER_HOME/bin 8 | ENV IP 127.0.0.1 9 | ENV RMI_PORT 1099 10 | 11 | RUN apk --update add openjdk7-jre tar unzip bash && \ 12 | rm -rf /var/cache/apk/* 13 | 14 | COPY dependencies /tmp/dependencies 15 | 16 | RUN tar -xzf /tmp/dependencies/apache-jmeter-${JMETER_VERSION}.tgz -C /usr/local && \ 17 | unzip -oq "/tmp/dependencies/JMeterPlugins-*.zip" -d $JMETER_HOME && \ 18 | rm -rf /tmp/dependencies 19 | 20 | ENV PATH $PATH:$JMETER_BIN 21 | 22 | WORKDIR $JMETER_HOME 23 | 24 | EXPOSE $RMI_PORT 25 | 26 | COPY docker-entrypoint.sh / 27 | 28 | ENTRYPOINT ["/docker-entrypoint.sh"] 29 | -------------------------------------------------------------------------------- /alpine/dependencies/JMeterPlugins-Extras-1.3.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hhcordero/docker-jmeter-server/5073213bc4afb437b7b437f39b60764d01b7798c/alpine/dependencies/JMeterPlugins-Extras-1.3.0.zip -------------------------------------------------------------------------------- /alpine/dependencies/JMeterPlugins-ExtrasLibs-1.3.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hhcordero/docker-jmeter-server/5073213bc4afb437b7b437f39b60764d01b7798c/alpine/dependencies/JMeterPlugins-ExtrasLibs-1.3.0.zip -------------------------------------------------------------------------------- /alpine/dependencies/JMeterPlugins-Standard-1.3.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hhcordero/docker-jmeter-server/5073213bc4afb437b7b437f39b60764d01b7798c/alpine/dependencies/JMeterPlugins-Standard-1.3.0.zip -------------------------------------------------------------------------------- /alpine/dependencies/apache-jmeter-2.13.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hhcordero/docker-jmeter-server/5073213bc4afb437b7b437f39b60764d01b7798c/alpine/dependencies/apache-jmeter-2.13.tgz -------------------------------------------------------------------------------- /alpine/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | freeMem=`awk '/MemFree/ { print int($2/1024) }' /proc/meminfo` 4 | s=$(($freeMem/10*8)) 5 | x=$(($freeMem/10*8)) 6 | n=$(($freeMem/10*2)) 7 | export JVM_ARGS="-Xmn${n}m -Xms${s}m -Xmx${x}m" 8 | JMETER_LOG="jmeter-server.log" && touch $JMETER_LOG && tail -f $JMETER_LOG & 9 | exec jmeter-server \ 10 | -D "java.rmi.server.hostname=${IP}" \ 11 | -D "client.rmi.localport=${RMI_PORT}" \ 12 | -D "server.rmi.localport=${RMI_PORT}" 13 | -------------------------------------------------------------------------------- /dependencies/JMeterPlugins-Extras-1.3.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hhcordero/docker-jmeter-server/5073213bc4afb437b7b437f39b60764d01b7798c/dependencies/JMeterPlugins-Extras-1.3.0.zip -------------------------------------------------------------------------------- /dependencies/JMeterPlugins-ExtrasLibs-1.3.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hhcordero/docker-jmeter-server/5073213bc4afb437b7b437f39b60764d01b7798c/dependencies/JMeterPlugins-ExtrasLibs-1.3.0.zip -------------------------------------------------------------------------------- /dependencies/JMeterPlugins-Standard-1.3.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hhcordero/docker-jmeter-server/5073213bc4afb437b7b437f39b60764d01b7798c/dependencies/JMeterPlugins-Standard-1.3.0.zip -------------------------------------------------------------------------------- /dependencies/apache-jmeter-2.13.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hhcordero/docker-jmeter-server/5073213bc4afb437b7b437f39b60764d01b7798c/dependencies/apache-jmeter-2.13.tgz -------------------------------------------------------------------------------- /docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | freeMem=`awk '/MemFree/ { print int($2/1024) }' /proc/meminfo` 4 | s=$(($freeMem/10*8)) 5 | x=$(($freeMem/10*8)) 6 | n=$(($freeMem/10*2)) 7 | export JVM_ARGS="-Xmn${n}m -Xms${s}m -Xmx${x}m" 8 | JMETER_LOG="jmeter-server.log" && touch $JMETER_LOG && tail -f $JMETER_LOG & 9 | exec jmeter-server \ 10 | -D "java.rmi.server.hostname=${IP}" \ 11 | -D "client.rmi.localport=${RMI_PORT}" \ 12 | -D "server.rmi.localport=${RMI_PORT}" 13 | --------------------------------------------------------------------------------