一、Jmeter Base 基础镜像
1.准备Dockerfile文件
# Use Java 8 slim JRE
FROM openjdk:8-jre-slim
#创建对应目录
RUN mkdir /jmeter
RUN mkdir -p /jmeter/test
RUN mkdir -p /jmeter/test/input/jmx
RUN mkdir -p /jmeter/test/input/testdata
RUN mkdir -p /jmeter/test/report/html
RUN mkdir -p /jmeter/test/report/jtl
RUN mkdir -p /jmeter/test/report/outputdata
#Jmeter 对应环境配置
ENV JMETER_VERSION=5.4.1
ENV JMETER_HOME=/jmeter/apache-jmeter-${JMETER_VERSION}
ENV JMETER_PATH=${JMETER_HOME}/bin:${PATH}
ENV PATH=${JMETER_HOME}/bin:${PATH}
#安装包复制
COPY apache-jmeter-${JMETER_VERSION}.tgz /jmeter
RUN cd /jmeter \
&& tar xvf apache-jmeter-${JMETER_VERSION}.tgz \
&& rm apache-jmeter-${JMETER_VERSION}.tgz
2.本地构建镜像
# cd 该Dockerfile 目录
docker build -t jmeter .
3.推送至私库
docker tag regdomain/test-team/jmeter jmeter
docker push regdomain/test-team/jmeter:latest
二、Jmeter Master
三、Jmeter Salve
|