Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: unsatisfiable constraints: curl (missing): while building for jmeter dockerfile

I unable to build jmeter docker file, getting below error.

    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="[email protected]"
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", "--?"]

Can anyone please let me know if anything missing

like image 842
Padma P Avatar asked Nov 07 '22 11:11

Padma P


1 Answers

The error indicates that Alpine apk package management tool wasn't able to install curl, fontconfig and other packages due to not being able to connect to http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/ host and get the files from there.

Ensure that your host machine has Internet and if it does follow recommendations from the My docker container has no internet answers.

Also be aware that currently JMeter 5.2 is out so I would recommend at least changing this line:

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

to this one:

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

otherwise your Dockerfile will not work even if you resolve Internet connectivity issues.

Optionally you can ramp-up JMETER_VERSION to match the latest stable JMeter release

like image 95
Dmitri T Avatar answered Dec 06 '22 18:12

Dmitri T