We’ve seen problems people have had with odd unreachability of github - people in China, people in some particular cloud provider. So, details of your provider and the location of the system might be (or might have been) useful to help understand the problem.
Sometimes the problem lies with the cloud provider.
(I say odd unreachability, because I think at least once github seemed accessible from the host but not within the container.)