Skip to content

Commit

Permalink
refine build with JMETER_VERSION ARG and docu
Browse files Browse the repository at this point in the history
  • Loading branch information
justb4 committed Jan 25, 2017
1 parent af2a4a4 commit 16f2523
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 134 deletions.
11 changes: 3 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ FROM alpine:3.5

MAINTAINER Just van den Broecke<just@justobjects.nl>

ENV JMETER_VERSION 3.1
ARG JMETER_VERSION="3.1"
ENV JMETER_HOME /opt/apache-jmeter-${JMETER_VERSION}
ENV JMETER_BIN ${JMETER_HOME}/bin
ENV JMETER_DOWNLOAD_URL http://mirror.serversupportforum.de/apache/jmeter/binaries/apache-jmeter-${JMETER_VERSION}.tgz
ENV IP 127.0.0.1
ENV RMI_PORT 1099

# Install extra packages
# See https://github.com/gliderlabs/docker-alpine/issues/136#issuecomment-272703023
Expand All @@ -22,7 +20,7 @@ RUN apk add --update openjdk7-jre tzdata curl unzip bash
# Clean APK cache
RUN rm -rf /var/cache/apk/*

# download and extract jmeter
# download and extract JMeter
RUN mkdir -p /tmp/dependencies
RUN curl -L --silent ${JMETER_DOWNLOAD_URL} > /tmp/dependencies/apache-jmeter-${JMETER_VERSION}.tgz
RUN mkdir -p /opt
Expand All @@ -33,12 +31,9 @@ RUN tar -xzf /tmp/dependencies/apache-jmeter-${JMETER_VERSION}.tgz -C /opt && \
# TODO: plugins (later)
# && unzip -oq "/tmp/dependencies/JMeterPlugins-*.zip" -d $JMETER_HOME

# Set global PATH such that "jmeter" command is found
ENV PATH $PATH:$JMETER_BIN

# We assume tests and results are passed to entrypoint
# and are external to docker image.
# COPY tests /tests

# Entrypoint has same signature as "jmeter" command
COPY entrypoint.sh /

Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# docker-jmeter

[![](https://images.microbadger.com/badges/image/justb4/jmeter.svg)](https://microbadger.com/images/justb4/jmeter "Get your own image badge on microbadger.com")

Docker image for [Apache JMeter](http://jmeter.apache.org).
The aim is to have a Docker image that can be run as the ``jmeter`` command
itself.
Expand All @@ -12,7 +14,12 @@ you may use your own ``docker build`` commandline.

### Build Options

None specific right now. NB timezone setting is not working yet.
Build argumments (see [build.sh](build.sh)) with default values if not passed to build:

- **JMETER_VERSION** - JMeter version, default ``3.1``
- **IMAGE_TIMEZONE** - timezone of Docker image, default ``"Europe/Amsterdam"``

NB **IMAGE_TIMEZONE** setting is not working yet.

## Running

Expand Down
8 changes: 7 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
sudo docker build -t="justobjects/jmeter:3.1" .
#!/bin/bash

JMETER_VERSION="3.1"

# Example build line
# --build-arg IMAGE_TIMEZONE="Europe/Amsterdam"
sudo docker build --build-arg JMETER_VERSION=${JMETER_VERSION} -t "justobjects/jmeter:${JMETER_VERSION}" .
Loading

0 comments on commit 16f2523

Please sign in to comment.