gpt4 book ai didi

jmeter - 错误 : unsatisfiable constraints: curl (missing): while building for jmeter dockerfile

转载 作者:行者123 更新时间:2023-12-04 11:41:13 27 4
gpt4 key购买 nike

我无法构建 jmeter docker 文件,出现以下错误。

    WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz: temporary error (try again later)
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz: temporary error (try again later)
ERROR: unsatisfiable constraints:
curl (missing):
required by: world[curl]
fontconfig (missing):
required by: world[fontconfig]
net-tools (missing):
required by: world[net-tools]
shadow (missing):
required by: world[shadow]
su-exec (missing):
required by: world[su-exec]
tcpdump (missing):
required by: world[tcpdump]
ttf-dejavu (missing):
required by: world[ttf-dejavu]
The command '/bin/sh -c chmod +x /usr/local/bin/entrypoint.sh && apk add --no-cache curl fontconfig net-tools shadow su-exec tcpdump ttf-dejavu && cd /tmp/ && curl --location --silent --show-error --output apache-jmeter-${JMETER_VERSION}.tgz ${MIRROR}/apache-jmeter-${JMETER_VERSION}.tgz && curl --location --silent --show-error --output apache-jmeter-${JMETER_VERSION}.tgz.sha512 ${MIRROR}/apache-jmeter-${JMETER_VERSION}.tgz.sha512 && sha512sum -c apache-jmeter-${JMETER_VERSION}.tgz.sha512 && mkdir -p /opt/ && tar x -z -f apache-jmeter-${JMETER_VERSION}.tgz -C /opt && rm -R -f apache* && sed -i '/RUN_IN_DOCKER/s/^# //g' ${JMETER_BIN}/jmeter && sed -i '/PrintGCDetails/s/^# /: "${/g' ${JMETER_BIN}/jmeter && sed -i '/PrintGCDetails/s/$/}"/g' ${JMETER_BIN}/jmeter && chmod +x ${JMETER_HOME}/bin/*.sh && jmeter --version && curl --location --silent --show-error --output /opt/alpn-boot-${ALPN_VERSION}.jar http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/${ALPN_VERSION}/alpn-boot-${ALPN_VERSION}.jar && rm -fr /tmp/*' returned a non-zero code: 7

Dockerfile:
FROM openjdk:8u201-jdk-alpine3.9
LABEL maintainer="emmanuel.gaillardon@orange.fr"
STOPSIGNAL SIGKILL
ENV MIRROR https://www-eu.apache.org/dist/jmeter/binaries
ENV JMETER_VERSION 5.1.1
ENV JMETER_HOME /opt/apache-jmeter-${JMETER_VERSION}
ENV JMETER_BIN ${JMETER_HOME}/bin
ENV ALPN_VERSION 8.1.13.v20181017
ENV PATH ${JMETER_BIN}:$PATH
COPY entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh \
&& apk add --no-cache \
curl \
fontconfig \
net-tools \
shadow \
su-exec \
tcpdump \
ttf-dejavu \
&& cd /tmp/ \
&& curl --location --silent --show-error --output apache-jmeter-${JMETER_VERSION}.tgz ${MIRROR}/apache-jmeter-${JMETER_VERSION}.tgz \
&& curl --location --silent --show-error --output apache-jmeter-${JMETER_VERSION}.tgz.sha512 ${MIRROR}/apache-jmeter-${JMETER_VERSION}.tgz.sha512 \
&& sha512sum -c apache-jmeter-${JMETER_VERSION}.tgz.sha512 \
&& mkdir -p /opt/ \
&& tar x -z -f apache-jmeter-${JMETER_VERSION}.tgz -C /opt \
&& rm -R -f apache* \
&& sed -i '/RUN_IN_DOCKER/s/^# //g' ${JMETER_BIN}/jmeter \
&& sed -i '/PrintGCDetails/s/^# /: "${/g' ${JMETER_BIN}/jmeter && sed -i '/PrintGCDetails/s/$/}"/g' ${JMETER_BIN}/jmeter \
&& chmod +x ${JMETER_HOME}/bin/*.sh \
&& jmeter --version \
&& curl --location --silent --show-error --output /opt/alpn-boot-${ALPN_VERSION}.jar http://central.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/${ALPN_VERSION}/alpn-boot-${ALPN_VERSION}.jar \
&& rm -fr /tmp/*
# Required for HTTP2 plugins
ENV JVM_ARGS -Xbootclasspath/p:/opt/alpn-boot-${ALPN_VERSION}.jar
WORKDIR /jmeter
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["jmeter", "--?"]

任何人都可以让我知道是否有任何遗漏

最佳答案

错误表明 Alpine apk package management tool无法安装 curl , fontconfig和其他软件包由于无法连接到 http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/主机并从那里获取文件。

确保您的主机具有 Internet 并且是否遵循 My docker container has no internet 中的建议答案。

另请注意,目前 JMeter 5.2出来了,所以我建议至少改变这一行:

ENV MIRROR https://www-eu.apache.org/dist/jmeter/binaries

对这个:
ENV MIRROR https://archive.apache.org/dist/jmeter/binaries

否则您的 Dockerfile即使您解决了 Internet 连接问题,也不会工作。

您可以选择增加 JMETER_VERSION匹配 latest stable JMeter release

关于jmeter - 错误 : unsatisfiable constraints: curl (missing): while building for jmeter dockerfile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59155197/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com