Debug Note - macOS run apt-get failed in docker

Thank iCloud Private Relay made this article. Cannot connect to via HTTP

I got an issue while I tried to use docker to build a PHP image. But it failed and the terminal showed the error log below.

截圖 2022-02-23 13.12.03.png

While I saw the error, the first thought in my mind was network might be blocked by anti-virus software or firewall. Then I checked the setting, it was normal. Then I found this issue comment. But it was still not working. However, it seemed an issue about the source.list.

I found the in source.list was different from others. It was a http:// and other domains were https://. So I change the to https://. It worked! But why?

I could understand why I need to connect via https. I keep researching. Therefore I found the answer from this comment.

The answer is -- macOS new feature iCloud Private Relay caused this issue.

Three small. Nice mac.
This is the journey I solve this issue.