1
votes

I am trying to build a docker image based on Alpine and I need to install few packages in it. Here is exactly what I am trying to do:

FROM alpine:latest
RUN apk --no-cache add ca-certificates=20161130-r2 openssl=1.0.2k-r0

But when I run docker build, here is the error I get:

RUN apk --no-cache add ca-certificates=20161130-r2 openssl=1.0.2k-r0
 ---> Running in a061dcd5071e
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
  ca-certificates-20171114-r0:
    breaks: world[ca-certificates=20161130-r2]
  openssl-1.0.2n-r0:
    breaks: world[openssl=1.0.2k-r0]
The command '/bin/sh -c apk --no-cache add ca-certificates=20161130-r2 openssl=1.0.2k-r0' returned a non-zero code: 2

I have tried running apk update and rebooting the machine but nothing seems to work. I can ping and open "http://dl-cdn.alpinelinux.org/alpine/v3.7/main/", any idea what could be the reason for this error here? Or how can I resolve it?

Looks like you are trying to install outdated versions of the ca-certificates and openssl packages. Is this a requirement for you? - whites11
Yes, I am supposed to install these versions only, is there any way? - Pensu
Dunno, you could try with an older version of alpine such as 3.6 for instance. - whites11
Sure, will try it out. Thanks! - Pensu