gliderlabs / docker-alpine

Alpine Linux Docker image. Win at minimalism!
http://gliderlabs.viewdocs.io/docker-alpine
BSD 2-Clause "Simplified" License
5.71k stars 529 forks source link

ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.10/main: No such file or directory #531

Closed Jtown0011 closed 4 years ago

Jtown0011 commented 4 years ago

I'm using the latest cookiecutter-django project template.

I attempted to run "docker-compose -f production.yml build --build-arg HTTP_PROXY=http://:8080 --build-arg HTTPS_PROXY=https://:8080" (leaving out the proxy ip for security)

but i get the following error when trying to build the django image

Building django Step 1/30 : FROM python:3.7-alpine ---> 8922d588eec6 Step 2/30 : ENV PYTHONUNBUFFERED 1 ---> Running in f5e1c186ae58 ---> 7c11af4c3c40 Removing intermediate container f5e1c186ae58 Step 3/30 : RUN apk update && apk add --virtual build-deps gcc python3-dev musl-dev && apk add postgresql-dev && apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev && apk add libffi-dev py-cffi ---> Running in be4913cea02f

fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/x86_64/APKINDEX.tar.gz ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.10/main: No such file or directory WARNING: Ignoring APKINDEX.00740ba1.tar.gz: No such file or directory ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.10/community: No such file or directory WARNING: Ignoring APKINDEX.d8b2a6f4.tar.gz: No such file or directory 2 errors; 35 distinct packages available ERROR: Service 'django' failed to build: The command '/bin/sh -c apk update && apk add --virtual build-deps gcc python3-dev musl-dev && apk add postgresql-dev && apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev && apk add libffi-dev py-cffi' returned a non-zero code: 2

I have verified that I can dig the domain dl-cdn.alpinelinux.org and checked the site ( https://dl-cdn.alpinelinux.org/alpine/v3.10/main/x86_64/ ) to verify the tar file is there APKINDEX.tar.gz

My guess is this is a cdn issue? I noticed the latest change to this tar APKINDEX.tar.gz was on November 16th 2019 which is two days ago (see attachment).

image

Jtown0011 commented 4 years ago

Closing this issue. I checked with my security team and this issue is related to firewall/proxy blocking traffic to the cdn.

marnandr commented 4 years ago

Hint to the build.

Use your host network with the --network host switch. Example: sudo docker build --network host --no-cache --rm -t myawesomeimage .

Or it is possible you need to use proxy. In this case use the --build-arguments switch to specify the proxies. Example: _sudo docker build --no-cache --rm --build-arg http_proxy=http://myproxy:myport httpsproxy=http://myproxy:myport -t myawesomeimage .

It's a temporary solution. If it is necesarry in the future configurate your docker network. The official article about this topic : https://docs.docker.com/network/ Not so much, but honest.

Probably this problem have been solved, but in the future may be helpful.