6

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

Can anyone please let me know if anything missing

Zeitounator
  • 38,476
  • 7
  • 53
  • 66
Padma P
  • 61
  • 1
  • 3
  • Did you check your network ? Are you behind a proxy ? If yes, did you configure it correctly for daemon and containers ? From the first two lines of warning, it looks like your docker container cannot access to the url to download the alpine packages. – Zeitounator Dec 03 '19 at 13:31

2 Answers2

1

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

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
0

Alpine-based JDK image you, in turn, are based on, is, actually, pretty basic (no pun intended!), it's stripped of pretty much everything beyond very core.

So, it just doesn't contain them utilities you're trying to use there - which it immediately reports back to you as missing.

On a bright side, though - it is really small, 5MB or so.

What you can do is two things:

1) Install the packages through Alpine package manager apk prior to using them (something like apk add curl, please figure out the exact package names yourself through apk search). That's kinda 'official' Alpine way to handle cases like that.

2) Base on some more generic Linux images. It would grow much bigger though, tens of megabytes, to my recollection.

Yuri G
  • 1,206
  • 1
  • 9
  • 13