jmeter 构建Docker镜像失败

7gcisfzg  于 2023-06-23  发布在  Docker
关注(0)|答案(1)|浏览(139)

我已经创建了下面的docker文件来安装JDK 16.0.2版本和Jmeter 5.5。在GitHub中推送更改时,“Build Jmeter Docker Image”步骤失败:
我可以看到以下错误:debconf: delaying package configuration, since apt-utils is not installed.有人能告诉我失败的原因吗
jmeter.yml文件

name: JMeter Tests
    on:
      push:
        branches:
          - "booking-*"
    jobs:
      jmeter:
        runs-on: ubuntu-latest
        steps:
        - name: Checkout code
          uses: actions/checkout@v2
        - name: Build JMeter Docker image
          run: docker build -t my-jmeter:latest .
        - name: Run JMeter tests
          run: |
     docker run --rm \
      -v ${PWD}:${PWD} \
      -w ${PWD} \
      my-jmeter:latest \
      -n -t test/CloudRun.jmx -l results/CloudRdunResults.jtl

下面是我的Dockerfile:

FROM openjdk:16-jdk-slim-buster

ENV JMETER_VERSION 5.5

RUN apt-get update && \
    apt-get install -y wget && \
    rm -rf /var/lib/apt/lists/*

RUN wget https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-${JMETER_VERSION}.tgz && \
    tar zxvf apache-jmeter-${JMETER_VERSION}.tgz && \
    rm apache-jmeter-${JMETER_VERSION}.tgz

ENV PATH $PATH:/apache-jmeter-${JMETER_VERSION}/bin
fcwjkofz

fcwjkofz1#

这个debconf: delaying package configuration, since apt-utils is not installed.可以安全地忽略,因为它不是“错误”,而是“警告”。
很难说为什么你的管道在没有看到它的完整输出的情况下失败,从第一眼看你的YAML syntax是无效的。
试试这个:

name: JMeter Tests
on:
  push:
    branches:
      - "booking-*"
jobs:
  jmeter:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Build JMeter Docker image
        run: docker build -t my-jmeter:latest .
      - name: Run JMeter tests
        run: |
          docker run --rm \
          my-jmeter:latest \
          jmeter -n -t /apache-jmeter-5.5/extras/Test.jmx

它应该生成映像并成功运行测试。然后根据你的需要修改它。
更多信息:How to Use Docker with JMeter

相关问题