skip to Main Content

I have tried to build the below Dockerfile, for the first time it built successfully but after that it is throwing the mentioned error. I am mentioning the Dockerfile and error below.

Dockerfile:

FROM alpine

RUN apk add --update redis

CMD ["redis-server"]

Error:

Sending build context to Docker daemon 2.048kB Step 1/3 : FROM alpine
—> e7d92cdc71fe Step 2/3 : RUN apk add –update redis —> Running in c03f589ce9da fetch
http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.11/main: temporary
error (try again later) WARNING: Ignoring APKINDEX.70f61090.tar.gz: No
such file or directory fetch
http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.11/community: temporary
error (try again later) WARNING: Ignoring APKINDEX.ca2fea5b.tar.gz: No
such file or directory ERROR: unsatisfiable constraints: redis
(missing):
required by: world[redis] The command ‘/bin/sh -c apk add –update redis’ returned a non-zero code: 1

2

Answers


  1. Kindly check http://dl-cdn.alpinelinux.org/alpine/v3.11 in your browser, if you are able to access then you can access through your docker container as well.

    Login or Signup to reply.
  2. Create a file daemon.json in the location: /etc/docker/daemon.json

    {
        "dns": ["8.8.8.8"]
    }
    

    Then restart docker:
    systemctl restart docker

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search