「CentOS Stream 8」dockerでjmeterをインストールする方法

2021年3月16日

1.gitバージョン確認
# git –version
git version 2.27.0
2.Dockerfileをダウンロード
# git clone https://github.com/justb4/docker-jmeter.git
# cd docker-jmeter
3.Dockerfile内容確認

# cat Dockerfile
# inspired by https://github.com/hauptmedia/docker-jmeter  and
# https://github.com/hhcordero/docker-jmeter-server/blob/master/Dockerfile
FROM alpine:3.12

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

ARG JMETER_VERSION="5.3"
ENV JMETER_HOME /opt/apache-jmeter-${JMETER_VERSION}
ENV     JMETER_BIN      ${JMETER_HOME}/bin
ENV     JMETER_DOWNLOAD_URL  https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-${JMETER_VERSION}.tgz

# Install extra packages
# See https://github.com/gliderlabs/docker-alpine/issues/136#issuecomment-272703023
# Change TimeZone TODO: TZ still is not set!
ARG TZ="Europe/Amsterdam"
RUN    apk update \
        && apk upgrade \
        && apk add ca-certificates \
        && update-ca-certificates \
        && apk add --update openjdk8-jre tzdata curl unzip bash \
        && apk add --no-cache nss \
        && rm -rf /var/cache/apk/* \
        && mkdir -p /tmp/dependencies  \
        && curl -L --silent ${JMETER_DOWNLOAD_URL} >  /tmp/dependencies/apache-jmeter-${JMETER_VERSION}.tgz  \
        && mkdir -p /opt  \
        && tar -xzf /tmp/dependencies/apache-jmeter-${JMETER_VERSION}.tgz -C /opt  \
        && rm -rf /tmp/dependencies

# 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

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

WORKDIR ${JMETER_HOME}

ENTRYPOINT ["/entrypoint.sh"]

4.シェルをビルドする
# ./build.sh

Successfully built 2668b45f1e63
Successfully tagged justb4/jmeter:5.3

5.テスト用シェルを実行
# ./test.sh
==== HTML Test Report ====
See HTML test report in tests/trivial/report/index.html

Docker

Posted by arkgame