一、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
# 开启ssl
RUN sed -i 's/#server.rmi.ssl.disable=false/server.rmi.ssl.disable=true/g' $JMETER_HOME/bin/jmeter.properties
2.本地构建镜像
# cd 该Dockerfile 目录
docker build -t jmeter .
3.推送至私库
dock