Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apk WARNING Ignoring APKINDEX No such file or directory #207

Open
gittycat opened this issue Aug 22, 2016 · 49 comments
Open

apk WARNING Ignoring APKINDEX No such file or directory #207

gittycat opened this issue Aug 22, 2016 · 49 comments

Comments

@gittycat
Copy link

gittycat commented Aug 22, 2016

I see a few issues related to this but they're all making it more complex to replicate.

Just running the following gets the WARNING.
Start from a "blank" host (no images loaded, no containers running)

docker run --rm -it alpine:3.4 apk info

output:

WARNING: Ignoring APKINDEX.5a59b88b.tar.gz: No such file or directory
WARNING: Ignoring APKINDEX.7c1f02d6.tar.gz: No such file or directory
musl
busybox
alpine-baselayout
alpine-keys
zlib
libcrypto1.0
libssl1.0
apk-tools
scanelf
musl-utils
libc-utils

Tested on both VMware Fusion and Docker4mac.
I also get the same WARNING using alpine:3.3

@gittycat gittycat changed the title api WARNING Ignoring APKINDEX No such file or directory apk WARNING Ignoring APKINDEX No such file or directory Aug 22, 2016
@gittycat
Copy link
Author

doing apk update fixes the problem (updates the index).

Request: Improve the error message.

@schlomo
Copy link

schlomo commented Jul 13, 2017

Please improve the message to be actionable, see http://blog.schlomo.schapiro.org/2015/04/warning-is-waste-of-my-time.html for rationale.

@sufius
Copy link

sufius commented Aug 26, 2017

This worked for me:

In your DOCKERFILE (in this one order):

First: Remove cache and tmp files

RUN rm -rf /var/cache/apk/* && \
    rm -rf /tmp/*

Second: Update

RUN apk update

@MichaelBrenden
Copy link

MichaelBrenden commented Jan 21, 2018

Error persists on alpine 3.7 -- JUST FOUND SOLUTION -- SEE BELOW

/ # apk update

fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.7/main: temporary error (try again later)
WARNING: Ignoring APKINDEX.70c88391.tar.gz: No such file or directory
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.7/community: temporary error (try again later)
WARNING: Ignoring APKINDEX.5022a8a2.tar.gz: No such file or directory
2 errors; 11 distinct packages available

Restarted docker (running on bare metal debian 9) -- no change.
Updated to latest DNS/bind etc. -- no change.
Cleared /tmp/* and /var/cache/apk/* as suggested -- no change.
Tried changing /etc/apk/repositories to use "dl-4" instead of "dl-cdn" -- no change.

Tried apk --no-cache update -- gives this different error:
fetch http://dl-4.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-4.alpinelinux.org/alpine/v3.7/main: temporary error (try again later)
fetch http://dl-4.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
WARNING: Ignoring http://dl-4.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz: temporary error (try again later)
fetch http://dl-4.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
ERROR: http://dl-4.alpinelinux.org/alpine/v3.7/community: temporary error (try again later)
fetch http://dl-4.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
WARNING: Ignoring http://dl-4.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz: temporary error (try again later)
2 errors; 11 distinct packages available

on bare metal debian 9 host:
/root # host dl-cdn.alpinelinux.org
dl-cdn.alpinelinux.org is an alias for global.prod.fastly.net.
global.prod.fastly.net has address 151.101.200.249

/root # host dl-4.alpinelinux.org
dl-4.alpinelinux.org is an alias for nl3.alpinelinux.org.
nl3.alpinelinux.org has address 147.75.32.21

but inside alpine:3.7 container:
/ # host dl-cdn.alpinelinux.org
/ # host dl-4.alpinelinux.org
both timed out

Discovered problem is DJB-DNS running on bare metal host -- it needed to be told to respond to DNS queries coming from 172.x.y.z (the docker containers):
/root # touch /service/dnscache/root/ip/172

@dustinbarnes
Copy link

I'm also having this issue with 3.7, but while building docker containers:

Step 2/28 : RUN echo "http://dl-cdn.alpinelinux.org/alpine/v3.7/main" > /etc/apk/repositories
 ---> Using cache
 ---> d41c056fd55a
Step 3/28 : RUN apk update && apk upgrade --available && sync
 ---> Running in 3058e7cea18e
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.7/main: temporary error (try again later)
WARNING: Ignoring APKINDEX.70c88391.tar.gz: No such file or directory
1 errors; 69 distinct packages available
The command '/bin/sh -c apk update && apk upgrade --available && sync' returned a non-zero code: 1

@FizWork
Copy link

FizWork commented Mar 19, 2018

So? What solution for this problem?

touch /service/dnscache/root/ip/172 <----> No such file or directory

@zhawan
Copy link

zhawan commented Apr 9, 2018

maybe your Docker DNS not work, try "docker run" with "--dns xxx.xxx.xxx.xxx ".
like
docker run --privileged --dns xxx.xxx.xxx.xxx --name testxxxx -dit gliderlabs/alpine

@martin-juul
Copy link

@dustinbarnes

I just had this issue, what fixed it for me is running the update as:

apk --update add --no-cache <yourPackage>

@guiccbr
Copy link

guiccbr commented Apr 16, 2018

This is very-very annoying. I was able to ping/download from the repos through my browser, but could not install vim neither anything because of this error:

docker run -ti alpine /bin/sh
Unable to find image 'alpine:latest' locally
latest: Pulling from library/alpine
Digest: sha256:7df6db5aa61ae9480f52f0b3a06a140ab98d427f86d8d5de0bedab9b8df6b1c0
Status: Downloaded newer image for alpine:latest
/ # apk add --no-cache vim
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz: BAD signature
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
  vim (missing):
    required by: world[vim]

SOLUTION that worked for me:

apk add --no-cache --wait 10 vim    <<--- Using `wait`

@Ilyes512
Copy link

Ilyes512 commented May 7, 2018

Dont use:

$ apk --update add --no-cache <yourPackage>

Because it will just ignore --no-cache and create cache files in /var/cache/apk anyways.

@gittycat
Copy link
Author

gittycat commented May 7, 2018

Re-opening this issue. It's obviously causing a lot of headaches still.

@gittycat gittycat reopened this May 7, 2018
@boydkelly
Copy link

Where can we follow this issue? I have a headache too. Not even with docker. Just in a kvm. Same problems.

@BhavaniShekhar
Copy link

I got the same issue . But the strange thing is running with all proxy environment did not worked. For me it got resolved when I've not running behind proxy that is without using connecting to VPN, then it allowing in plain vanila network apk update works.

namelessvoid added a commit to namelessvoid/newman that referenced this issue Sep 15, 2018
Updating to alpine 3.8 introduced some warnings during building the
docker image, e.g.:
'WARNING: Ignoring APKINDEX.cd3a9dc2.tar.gz: No such file or directory'

This can be fixed by running 'apk update' instead of 'apk add --update',
see: gliderlabs/docker-alpine#207
hangy added a commit to openfoodfacts/openfoodfacts-server that referenced this issue Sep 20, 2018
Update Alpine package cache once.

see gliderlabs/docker-alpine#207
@IanLee1521
Copy link

Seeing the same thing:

> docker run -it --rm alpine:3.7
Unable to find image 'alpine:3.7' locally
3.7: Pulling from library/alpine
c67f3896b22c: Pull complete
Digest: sha256:a52b4edb6240d1534d54ee488d7cf15b3778a5cfd0e4161d426c550487cddc5d
Status: Downloaded newer image for alpine:3.7
/ #
/ #
/ # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.7/main: BAD signature
WARNING: Ignoring APKINDEX.70c88391.tar.gz: No such file or directory
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.7/community: BAD signature
WARNING: Ignoring APKINDEX.5022a8a2.tar.gz: No such file or directory
2 errors; 13 distinct packages available

teolemon added a commit to openfoodfacts/openfoodfacts-server that referenced this issue Oct 27, 2018
* HR Content (#1346)

HR Content

* GA content (#1358)

GA content

* Delete index.html

* Ro content (#1347)

Ro content

* open beauty facts specific strings (#1335)

* Replace { "key" => $key} by { key => $key }.

* Fix HTML syntax error in translations.

* Suomi (fi) (#1345)

Suomi (fi)

* Delete open-food-hunt-2015.html

* Delete index.html

* lv content (#1352)

lv content

* Expand Open Pet Food Facts specific strings

* Portuguese translations refresh

* Delete index.html

* Delete index.html

* Delete index.html

* Japanese content (#1370)

Japanese content

* Turkish content (#1371)

Turkish content

* Hebrew updates (#1369)

Hebrew updates

* Indonesian (#1365)

* chinese-update (#1366)

chinese-update

* Delete index.html

* Russian translations updates (#1368)

* Russian translations updates

Russian translations updates

* Delete index.html

* off specific strings (#1336)

* Rename common-web.pot to obsolete.pot

* Update common.pot

* Update common.pot

* nova config

* cleanup

* new welcome email, footer links

* partners page

* Address review comments.

* Update Dockerfile

Update Alpine package cache once.

see gliderlabs/docker-alpine#207

* Update Dockerfiles

- Ignore more directories/files.
- Update Alpine package index explicitly.
- Use multi-stage build for a little bit leaner backend runtime builds.
- Add multi-stage build frontend image.-

* Ignore some *huge* images/presentations in the misc directory.

* Remove yarn.lock from .dockerignore to ensure that the Docker image is build with the correct snapshot.

* Further optimize frontend Dockerfile by only copying the html directory that's being served by nginx.

* Reset yarn.lock to fix core dump related to gulp.

see nodejs/node#20281

* Update openproductsfacts.pot

* display risk of additivs overexposure, bug #1374

* Update en.po

Fix merge error. Closes #1114

Co-authored-by: Mohit Sharma <[email protected]>
Signed-off-by: hangy <[email protected]>

* display risk of over-exposure for additives, bug #1374

* display risk of over-exposure for additives, bug #1374

* small updates and https support for howmuchsugar.in combiendesucres.fr

* update paths

* Open Beauty Facts taxonomies

* small fix

* merge static pages for small languages

* arabic static pages

* add French translations in addition to current translations

* add obf static pages

* vietnamese (#1387)

* common-many (#1389)

* common files for many languages (#1388)

* states taxonomy translations

* Update ko.po

* Update bn.po

* Update eu.po

* Add files via upload (#1390)

* OPF fixes part 2

* Italy static refresh (#1391)

* arabic static updates

* Danish

* Fix h2 tag

* Hebrew translations

* fixing CoC for ja

* Add files via upload

* fixes for OBF specific strings

* fixes for OFF specific strings

* fixes for OPFF

* German common translations (#1386)

* German common translations

German common translations

* Fix some incorrect translations and match _s/_p translations to use the same word.

* Add files via upload

* Add a simple Kubernetes config.s

Squashed commit of the following:

commit 7608cc1
Author: hangy <[email protected]>
Date:   Wed Sep 26 14:49:55 2018 +0200

    Log the Log4Perl output to a sidecar container to make it available to Kubernetes.ton

commit 3766824
Author: hangy <[email protected]>
Date:   Wed Sep 26 14:01:23 2018 +0200

    Add init container.

commit b83f6e5
Author: hangy <[email protected]>
Date:   Wed Sep 26 13:36:22 2018 +0200

    Remove `scripts` from dockerignore.

    We actually need scripts like build_lang.pl to init the containers..r

commit e9172e4
Author: hangy <[email protected]>
Date:   Wed Sep 26 12:31:34 2018 +0200

    Update backend-dev to use the same copy mechanism as backend.

commit 8e9aa06
Author: hangy <[email protected]>
Date:   Sat Sep 22 12:22:27 2018 +0200

    Add Kubernetes configuration for the backend

commit a771793
Author: hangy <[email protected]>
Date:   Fri Sep 21 16:35:41 2018 +0200

    Add Kubernetes configuration for the frontend.Aadd Kubernetes configuration for the frontend.

* update ingredients taxonomy, fix ingredients test

* fix for allergens

* Add Kubernetes config as a helm chart.

Squashed commit of the following:

commit b7f9f824d6d71331e25e9e188a3909a22a0c3e05
Author: hangy <[email protected]>
Date:   Thu Sep 27 00:03:03 2018 +0200

    Set higher limit for backend liveness probes.

commit 0c665519c0f830a32737b2737946f4c224d47d89
Author: hangy <[email protected]>
Date:   Wed Sep 26 23:46:31 2018 +0200

    Fix named port in readyness/liveness check.

commit 27bfc4ca8f8f0cfd69c6b3594881e0602cd0dbd5
Author: hangy <[email protected]>
Date:   Wed Sep 26 23:28:29 2018 +0200

    Add stable/mongodb as a reference.

commit 963de1279edfe5bfdefcad806da728ad8df33c67
Author: hangy <[email protected]>
Date:   Wed Sep 26 23:08:04 2018 +0200

    Move kubernetes files to a simple Helm chart.

    This still needs to include MongoDB.

* Add files via upload

* small fixes for additives and ingredients (stopwords)

* scripts to generate taxonomies, new additives_classes taxonomy with descriptions

* added additives classes to additives taxonomy

* update additives classes taxonomies

* update obf ingredients

* Squashed commit of the following:

commit 002aa7cf965cd2929fb8e1a49b7f16c60975039d
Author: hangy <[email protected]>
Date:   Sat Sep 29 10:42:15 2018 +0200

    Avoid accidentally adding the charts directory to git.

commit 7f474c751a5b2a9798addff4b76d6d9428b17497
Author: hangy <[email protected]>
Date:   Sat Sep 29 02:37:51 2018 +0200

    Use full release name for PVCs.

commit bbcccfbf7bbb278f5c1e8dedc24b771365c8b7dc
Author: hangy <[email protected]>
Date:   Sat Sep 29 02:31:34 2018 +0200

    Frontend does not need to write to the product images mount.

* Use ESLint instead of JSHint.

In comparison with JSHint, ESLint seems to be more configurable, and allows plugins to be used.

* Update backend dockerfile

* new structured data for overexposure risk + fix for e-numbers with a letter

* Apply suggestions from 40524a5 to other Dockerfiles.

* added Kosovo

* Use full K8S/helm generated backend service name.

* add wikipedia abstracts in additives taxonomy

* new structured data for overexposure risk + fix for e-numbers with a letter

* new structured data for overexposure risk + fix for e-numbers with a letter

* Ignore `.vstags`

* fixing unescaped url

* generate 2 json files for taxonomies, with or without wikipedia abstracts

* put back stopwords in additives taxonomy

* add .editorconfig

* allow to undeleted products

* add automatic generation of table of contents for texts

* guide for producers

* make sure English is listed first

* updates to labels and ingredients taxonomies

* Update common.pot

* Update az.po

* Update bg.po

* Update bn.po

* Update ca.po

* Update cs.po

* Update ar.po

* update tags

* Update fr.po

* update paths

* Use a static file for nginx' live/ready check.

* Fix MongoDB host for Helm.

* Add files via upload (#1421)

* Fixes #856: Remove s from aperçus (#1420)

* Remove s from aperçus

* Remove s from aperçus

* fix typo

* translation merging

* obf merge

* more translation merges

* Not translate footer links

* Fix travis vi lang test

Not translate footer links. Just translate footer labels.

* Fix travis by following Perl::Critic policy check

Perl::Critic encoding policy requires ":encoding(UTF-8)"
cf. https://metacpan.org/pod/release/ELLIOTJS/Perl-Critic-1.116/lib/Perl/Critic/Policy/InputOutput/RequireEncodingWithUTF8Layer.pm

* Fix travis by following Perl::Critic policy check

Perl::Critic encoding policy requires ":encoding(UTF-8)"
cf. https://metacpan.org/pod/release/ELLIOTJS/Perl-Critic-1.116/lib/Perl/Critic/Policy/InputOutput/RequireEncodingWithUTF8Layer.pm

* Fix contribute and discover links

* update according to goot pratices

* Update vi.po

* Update vi.po

* Update de.po

* add missing files

* refresh states

* commit changes to faq

* fix opf

* opff fixes

* fix obf

* fix off

* merge static files

* add common for s languages will break links

* more common files

* add t files

* fix perl warnings

* Add files via upload

* add producer page for translations

* Delete .DS_Store

* Add files via upload

* fix stats headers in nutrition tables, add nutriscore

* update the categories taxonomy

* add producer pages

* aucun changement

* merge more langs

* Update sl.po

* Add files via upload

* merge

* Remove manual CSRF token checks.

* Use SameSite=Lax for CSRF defense.

* Use up-to-date DateTime module instead of DateTime::Format::CLDR for datetime formatting.

* Remove apparently unused DateTime::Format::Mail module.

* Generate 'months' and 'weekdays' translations using the DateTime::Locale module.

* Update unit tests

- Months tests needs to match the content-wise equivalent JSON:PP output,
- Weekdays should probably be tested.A

* Fix display_date_tag.

* Make memcached server address configurable.

* hebrew updates

* New translations common.pot (Hebrew)

* New translations open-food-hunt-2015.html (Hebrew)

* New translations producers.html (Hebrew)

* new admin

* fix permissions back to 644

* Divide percentage by 100.0 to avoid display issues.

* Include bower_components in the Docker context, so that it can be added to the HTML directory.

* Until #666 is fixed, we need to pin MongoDB to <2.0.

Deprecated methods like MongoDB::Cursor::count were removed in 2.0 and
thus caused the following error if a more recent MongoDB was installed.

Can't locate object method "count" via package "MongoDB::Cursor" at
/opt/product-opener/lib/ProductOpener/Display.pm line 3159.

* Fix locale existence check.

* Copy @bower_components from the builder stage.

* Remove livenessProbe and readinessProbe for the backend.

* Update crowdin.yml

* new tests for additives and ingredients

* clean ingredients list and remove nutrition facts from them, bug #1433

* clean ingredients list and remove nutrition facts from them, bug #1433

* Update .editorconfig

* more ingredients list cleaning, bug #1433

* Update Ingredients.pm

* Update Ingredients.pm

* Update Ingredients.pm

* added 2 labels

* overflow tag list #246

* new after ingredients strings

* remove useless slash in HTML5

* remove extra % signs, call decimal formatter for all places in the nutrition table

* fixes to the English producer page

* Update producers.html

* Delete obsolete.pot

* Update Crowdin configuration file

* allow multiple spaces

* Italian logo

* Italian logo

* Vi and it

* support for Italy

* Add files via upload

* NOVA

* rename Vietnamese text

* added a donation top banner

* rename Vietnamese text

* fix

* fixes

* New translations nova-groups-for-food-processing.html (Spanish) (#1447)
@zdsccc
Copy link

zdsccc commented Nov 16, 2018

is there any other solutions? my alpine is 3.8

@Xnyle
Copy link

Xnyle commented Dec 20, 2018

I don't htink this has anything to do with alpine or anything inside the container, it's simply a docker network problem. You can check it with docker run --rm alpine:3.8 ping 8.8.8.8
For me this is working on 5 of 6 100% identicaly provisioned nodes but not on the 6th.

@JohanAR
Copy link

JohanAR commented Jan 15, 2019

For me it was an issue with Docker and DNS config, therefore "ping 8.8.8.8" worked fine while "ping dl-cdn.alpinelinux.org" did not. I solved it by copying a docker config specific to our company intranet, but something generic like this could work for others

@LomaxOnTheRun
Copy link

For anyone still struggling with this, I fixed this by having a VPN turned on whilst building the Docker image. No idea why it worked, apologies.

@agathebower
Copy link

agathebower commented Aug 14, 2019

so these are the ideas, that came up so far...

  • apk update

  • RUN rm -rf /var/cache/apk/* &&
    rm -rf /tmp/*

  • restarted docker daemon

  • restarted docker daemon with explicid dns option in .service

  • apk --update ...

  • apk add --no-cache ...

  • apk --update add --no-cache ...

  • apk add --no-cache --wait 10 ...

sadly this didn't do the trick for me :(
any news on this?

@kotauchisunsun
Copy link

@agathebower

This command is not work.

$ sudo docker run --rm alpine ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
^C
--- 8.8.8.8 ping statistics ---
9 packets transmitted, 0 packets received, 100% packet loss

But, this command is work.

$ sudo docker run --rm --network=host alpine ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=54 time=4.240 ms
64 bytes from 8.8.8.8: seq=1 ttl=54 time=11.171 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 4.240/7.705/11.171 ms

@ihtiking
Copy link

Insert in Dockerfile next string:

RUN rm -rf /var/cache/apk/* &&
rm -rf /tmp/*

RUN apk update

Next restart docker

And next run build docker image.

@lexyan
Copy link

lexyan commented Sep 26, 2019

thing that work for me 'docker build --network=host .'

@EduardoFLima
Copy link

sudo systemctl stop/start docker worked for me !

@mcdviii
Copy link

mcdviii commented Nov 13, 2019

thing that work for me 'docker build --network=host .'

This forces docker to use the host network to resolve DNS requests?

@KEINOS
Copy link

KEINOS commented Dec 19, 2019

@kotauchisunsun and @lexyan solution using --network=host option worked for me. Thanks.

TL; DR

docker build --network=host .

TS; DR

I noticed that the CDN itself isn't the issue because downloading directly from the host succeeds.

$ # fail to fetch from CDN. Here it seems that CDN is down.
$ docker build -t sample .
...
Step 4/18 : RUN apk add --no-cache --update   ca-certificates   curl   ffmpeg   git   make   rtmpdump   tzdata
 ---> Running in 97d093634b58
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/armhf/APKINDEX.tar.gz
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.10/main/armhf/APKINDEX.tar.gz: IO ERROR
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/armhf/APKINDEX.tar.gz
WARNING: Ignoring http://dl-cdn.alpinelinux.org/alpine/v3.10/community/armhf/APKINDEX.tar.gz: IO ERROR
ERROR: unsatisfiable constraints:
  curl (missing):

  tzdata (missing):
    required by: world[tzdata]
The command '/bin/sh -c apk add --no-cache --update   ca-certificates   curl   ffmpeg   git   make   rtmpdump   tzdata' returned a non-zero code: 6
$ # but direct download from the host, CDN seems working 
$ curl -O http://dl-cdn.alpinelinux.org/alpine/v3.10/main/armhf/APKINDEX.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  731k  100  731k    0     0  1879k      0 --:--:-- --:--:-- --:--:-- 1879k
$ # Re-try using host's network
$ docker build -t sample --network=host .
...
Step 4/18 : RUN apk add --no-cache --update   ca-certificates   curl   ffmpeg   git   make   rtmpdump   tzdata
 ---> Running in 82abec1ef8e5
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/main/armhf/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.10/community/armhf/APKINDEX.tar.gz
(1/55) Installing nghttp2-libs (1.39.2-r0)
(2/55) Installing libcurl (7.66.0-r0)
(3/55) Installing curl (7.66.0-r0)
(4/55) Installing sdl2 (2.0.10-r0)
...
$ # 🎉 

So, maybe somehow the MTU might differ between the host's network and Docker network, I assume.

  • Docker: 18.06.3-ce
  • Base image: Alpine Linux v3.10.3
  • Host: macOS Catalina 10.15.7

@tchafack
Copy link

As far i'm concerned, I even tried this one https://github.com/gliderlabs/docker-alpine/issues/509 and it did'nt work till I even restart my pc.

Finally, I changed the network (wifi from library) i was logged to my personal smartphone and it fixed it

@myxss
Copy link

myxss commented Feb 26, 2020

sudo systemctl stop/start docker 为我工作!

good

@MaksatGalymzhan
Copy link

I finally solved it. I just turned on VPN.

@mike-rg
Copy link

mike-rg commented Aug 4, 2020

I used
sudo systemctl restart docker && sudo systemctl restart NetworkManager

and then, if you have a docker-compose.yaml file.
docker-compose build

Regards!

@slim-hmidi
Copy link

I got the same error when I run docker build ..
Dockerfile:

FROM adoptopenjdk/openjdk11:alpine


 # install maven
RUN rm -rf /var/cache/apk/* && \
     rm -rf /tmp/* && \
apk update && \
apk add --no-cache curl tar bash

/// the rest of command

when I build the image, I got this error:

Sending build context to Docker daemon  62.65MB
Step 1/16 : FROM adoptopenjdk/openjdk11:alpine
 ---> 6b1ec1e25ce8
Step 2/16 : RUN rm -rf /var/cache/apk/* &&      rm -rf /tmp/* && apk update && apk add --no-cache curl tar bash
 ---> Running in 2302d9fff9a7
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.12/main: DNS lookup error
WARNING: Ignoring APKINDEX.2c4ac24e.tar.gz: No such file or directory
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
2 errors; 17 distinct packages available
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.12/community: DNS lookup error
WARNING: Ignoring APKINDEX.40a3604f.tar.gz: No such file or directory
The command '/bin/sh -c rm -rf /var/cache/apk/* &&      rm -rf /tmp/* && apk update && apk add --no-cache curl tar bash' returned a non-zero code: 2

I'm using windows 10 and I'm connecting on VPN made by the company.
How can I fix that?

@ncopa
Copy link
Collaborator

ncopa commented Aug 18, 2020

ERROR: .... DNS lookup error
How can I fix that?

Maybe fix your DNS?

@gtirloni
Copy link

gtirloni commented Oct 5, 2020

I faced this issue today and it was caused by conflicting firewall rules added by firewalld.

# systemctl stop firewalld
# systemctl disable firewalld
# systemctl restart docker

And the error was gone.

Environment: Fedora 33 Beta, Docker CE 19.03.13

@gregcsokas
Copy link

I faced this issue today and it was caused by conflicting firewall rules added by firewalld.

# systemctl stop firewalld
# systemctl disable firewalld
# systemctl restart docker

And the error was gone.

Environment: Fedora 33 Beta, Docker CE 19.03.13

I found this, and it's solves the issue without killing the firewalld

firewall-cmd --permanent --zone=trusted --add-interface=docker0
firewall-cmd --reload

@xupengggggg
Copy link

"--network=host" option worked for me

@ghost
Copy link

ghost commented Dec 29, 2020

I see a few issues related to this but they're all making it more complex to replicate.

Just running the following gets the WARNING.
Start from a "blank" host (no images loaded, no containers running)

docker run --rm -it alpine:3.4 apk info

output:

WARNING: Ignoring APKINDEX.5a59b88b.tar.gz: No such file or directory
WARNING: Ignoring APKINDEX.7c1f02d6.tar.gz: No such file or directory
musl
busybox
alpine-baselayout
alpine-keys
zlib
libcrypto1.0
libssl1.0
apk-tools
scanelf
musl-utils
libc-utils

Tested on both VMware Fusion and Docker4mac.
I also get the same WARNING using alpine:3.3

@caezsar
Copy link

caezsar commented Mar 24, 2021

For me it was because of EOF conversion from Windows (notepad++) to Unix (LF)

Always edit file via Unix editor first

@vmagnan
Copy link

vmagnan commented May 27, 2021

This error happened to me because I had removed the docker's default bridge network in /etc/docker/daemon.json.
Here is a fix :

{
 "default-address-pools":
 [
 {"base":"10.10.0.0/16","size":24}
 ]
}

And choose a default subnet that is not used or resolved in your network.

@jkariscodes
Copy link

@dustinbarnes

I just had this issue, what fixed it for me is running the update as:

apk --update add --no-cache <yourPackage>
What I get ERROR: '--update' is not an apk command. See 'apk --help'.
image

@gtirloni
Copy link

gtirloni commented May 6, 2022

@dustinbarnes
I just had this issue, what fixed it for me is running the update as:
apk --update add --no-cache <yourPackage>
What I get ERROR: '--update' is not an apk command. See 'apk --help'.
image

apk --update add --no-cache is a single command. Your screenshot shows two commands chained with &&.

@shakaran
Copy link

shakaran commented Aug 3, 2022

Another quick and dirty solution for avoid this 2-2 problem (chicken & egg) if you are using a corporate proxy, and building in local, it is change https to http in url repositories, so the fetch will work for ca-certificates and later you can update (note that this is more insecure since you are using http instead https, this is because a "dirty" workaround).

RUN sed -ie "s/https/http/g" /etc/apk/repositories

@dreamerlzl
Copy link

I faced this issue today and it was caused by conflicting firewall rules added by firewalld.

# systemctl stop firewalld
# systemctl disable firewalld
# systemctl restart docker

And the error was gone.
Environment: Fedora 33 Beta, Docker CE 19.03.13

I found this, and it's solves the issue without killing the firewalld

firewall-cmd --permanent --zone=trusted --add-interface=docker0
firewall-cmd --reload

this
I try "--network=host" but failed, and this helps me resolve the issue (Fedora 36 here)

@justdan23
Copy link

If you are working in a closed environment using a Dockerfile, the following will make it stop trying to reach the internet which it can never reach:

RUN mv /etc/apk/repositories /etc/apk/repositories.disabled

Then your offline docker compose install will speed through all the "apk add" commands to install all of the Alpine packages 📦 into your Docker Container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests