docker / for-mac

Bug reports for Docker Desktop for Mac
https://www.docker.com/products/docker#/mac
2.44k stars 119 forks source link

Docker Desktop on mac OS Big Sur 11.1 makes error on “RUN apt-get -y update” #5210

Closed rmenoli closed 3 years ago

rmenoli commented 3 years ago

I have the following problem: If I try to build an image from this dockerfile:

FROM python:3.7
RUN apt update

I'm building it with the following command: docker build -t myimage got the following error:

=> ERROR [ 2/12] RUN apt update                      1.7s
------
 > [ 2/12] RUN apt update:
#4 0.263 
#4 0.263 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#4 0.263 
#4 0.479 Get:1 http://deb.debian.org/debian buster InRelease [121 kB]
#4 0.485 Get:2 http://security.debian.org/debian-security buster/updates InRelease [65.4 kB]
#4 0.539 Get:3 http://deb.debian.org/debian buster-updates InRelease [51.9 kB]
#4 0.731 Get:4 http://deb.debian.org/debian buster/main amd64 Packages [7907 kB]
#4 0.732 Err:4 http://deb.debian.org/debian buster/main amd64 Packages
#4 0.732  File has unexpected size (13243 != 7907472). Mirror sync in progress? [IP: 199.232.82.132 80]
#4 0.733  Hashes of expected file:
#4 0.733  - Filesize:7907472 [weak]
#4 0.733  - SHA256:c88216232d353afbc95e57a5ad04fc515335fb75659dbcae6967cd1109b7e4fb
#4 0.733  - MD5Sum:6043a440cb8038062bed716e76b3d7e7 [weak]
#4 0.733  Release file created at: Sat, 05 Dec 2020 10:35:57 +0000
#4 0.832 Get:5 http://security.debian.org/debian-security buster/updates/main amd64 Packages [259 kB]
#4 0.832 Err:5 http://security.debian.org/debian-security buster/updates/main amd64 Packages
#4 0.832  File has unexpected size (13293 != 258660). Mirror sync in progress? [IP: 199.232.82.132 80]
#4 0.832  Hashes of expected file:
#4 0.832  - Filesize:258660 [weak]
#4 0.832  - SHA256:21b75b00a03e029a2c1fc1c61178aeb6e275bbed9fdead48428d54e378d68157
#4 0.832  - MD5Sum:865c5ab415b1ef08280ed820220b403d [weak]
#4 0.832  Release file created at: Fri, 01 Jan 2021 07:01:42 +0000
#4 1.492 Get:6 http://deb.debian.org/debian buster-updates/main amd64 Packages [7860 B]
#4 1.492 Err:6 http://deb.debian.org/debian buster-updates/main amd64 Packages
#4 1.492  File has unexpected size (13259 != 7860). Mirror sync in progress? [IP: 199.232.82.132 80]
#4 1.492  Hashes of expected file:
#4 1.492  - Filesize:7860 [weak]
#4 1.492  - SHA256:55463230b47ea54463b1a8e687f24d60c0c8d4dccd1868ef26713e3fe11f7f20
#4 1.492  Release file created at: Fri, 01 Jan 2021 14:06:09 +0000
#4 1.497 Fetched 239 kB in 1s (203 kB/s)
#4 1.497 Reading package lists...
#4 1.510 E: Failed to fetch http://deb.debian.org/debian/dists/buster/main/binary-amd64/by-hash/SHA256/c88216232d353afbc95e57a5ad04fc515335fb75659dbcae6967cd1109b7e4fb File has unexpected size (13243 != 7907472). Mirror sync in progress? [IP: 199.232.82.132 80]
#4 1.511  Hashes of expected file:
#4 1.511   - Filesize:7907472 [weak]
#4 1.512   - SHA256:c88216232d353afbc95e57a5ad04fc515335fb75659dbcae6967cd1109b7e4fb
#4 1.513   - MD5Sum:6043a440cb8038062bed716e76b3d7e7 [weak]
#4 1.513  Release file created at: Sat, 05 Dec 2020 10:35:57 +0000
#4 1.513 E: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/main/binary-amd64/by-hash/SHA256/21b75b00a03e029a2c1fc1c61178aeb6e275bbed9fdead48428d54e378d68157 File has unexpected size (13293 != 258660). Mirror sync in progress? [IP: 199.232.82.132 80]
#4 1.513  Hashes of expected file:
#4 1.514   - Filesize:258660 [weak]
#4 1.514   - SHA256:21b75b00a03e029a2c1fc1c61178aeb6e275bbed9fdead48428d54e378d68157
#4 1.515   - MD5Sum:865c5ab415b1ef08280ed820220b403d [weak]
#4 1.515  Release file created at: Fri, 01 Jan 2021 07:01:42 +0000
#4 1.516 E: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/main/binary-amd64/by-hash/SHA256/55463230b47ea54463b1a8e687f24d60c0c8d4dccd1868ef26713e3fe11f7f20 File has unexpected size (13259 != 7860). Mirror sync in progress? [IP: 199.232.82.132 80]
#4 1.517  Hashes of expected file:
#4 1.517   - Filesize:7860 [weak]
#4 1.517   - SHA256:55463230b47ea54463b1a8e687f24d60c0c8d4dccd1868ef26713e3fe11f7f20
#4 1.517  Release file created at: Fri, 01 Jan 2021 14:06:09 +0000
#4 1.518 E: Some index files failed to download. They have been ignored, or old ones used instead.
------
executor failed running [/bin/sh -c apt update]: exit code: 100I got the following error:

I'm working on MAC OS Big Sur 11.1 If I do the same command on an Ubuntu machine on AWS with the same Dockerfile and it worked!

I get the same error even with the following Dockerfile:

FROM ubuntu:18.04

RUN apt-get update

I tried to uninstall and reinstall docker desktop but nothing changed.. I have Docker 3.0.3

What is the problem?

stephen-turner commented 3 years ago

It looks to me like the error is in the Debian package repository not in any Docker code.

DanyHenriquez commented 3 years ago

It does work on Catalina and before. When browsing the page from the Macbook itself it also doesn't allow the page to be displayed on Big Sur but it does on Catalina.

This all points to a combination of the package repo and Big Sur

ahmedalawady commented 3 years ago

I have this problem after update to 11.2.3 Big Sur, any advice please?

fraukesch commented 3 years ago

Had the very same issue. Turned out that ScreenTime was blocking the debian URLs.

To solve the issue you need to visit all URLs that show with "failed to fetch" in your error log, e.g.

http://deb.debian.org/debian/dists/buster/main/binary-amd64/by-hash/SHA256/c88216232d353afbc95e57a5ad04fc515335fb75659dbcae6967cd1109b7e4fb

and click on "Add to list".

Found a hint here: https://stackoverflow.com/questions/62185692/docker-apt-update-some-index-files-failed-to-download-they-have-been-ignored

ahmedalawady commented 3 years ago

Thank you @fraukesch it's working

docker-robott commented 3 years ago

Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle locked