1

Using a Dockerfile, I want to install libmhash from an alpine based image (FROM varnish:7.0-alpine)

I need those packages to make my dockerfile to work:

RUN apk update && apk add --no-cache \
    python3 \
    py3-docutils \
    py3-sphinx \
    varnish-dev \
    curl \
    libtool \
    automake \
    git \
    autoconf \
    musl \
    libmhash \
    openssl-dev

And I have this error:

#5 1.064 fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/aarch64/APKINDEX.tar.gz
#5 1.423 fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/aarch64/APKINDEX.tar.gz
#5 1.863 ERROR: unable to select packages:
#5 1.883   libmhash (no such package):

As you can see, I am M1 Pro... What I don't understand, I saw an ARM version of the package: https://pkgs.alpinelinux.org/contents?file=&path=&name=libmhash&branch=edge&repo=testing&arch=armv7

Any workaround ?

Vincent Decaux
  • 9,857
  • 6
  • 56
  • 84
  • 1
    This package is only on the edge package repository, not in the version **3.14** from which the `varnish:7.0-alpine` image derives: https://pkgs.alpinelinux.org/contents?file=&path=&name=libmhash&branch=v3.14&repo=main&arch=armv7 – β.εηοιτ.βε Jan 05 '22 at 21:46
  • Also mind that you don't have to match the architecture of your host to an architecture on your container (that would actually defeat the purpose of containers): https://stackoverflow.com/a/69119815/2123530 – β.εηοιτ.βε Jan 05 '22 at 21:51
  • @β.εηοιτ.βε you are right, missreaded, working on the edge repo, thanks – Vincent Decaux Jan 06 '22 at 07:34

1 Answers1

1

According to the first comment, indeed it's only in testing, so I got it working this way:

RUN apk update && apk add --no-cache \
    python3 \
    py3-docutils \
    py3-sphinx \
    libtool \
    make \
    automake \
    git \
    autoconf \
    libmhash-dev --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/
Vincent Decaux
  • 9,857
  • 6
  • 56
  • 84