Are you operating in a special territory such as mainland China?
I would check DNS on your host and then check DNS in your docker.
check DNS on your host:
resolvectl status|egrep Servers
nslookup github.com
check DNS in your docker
docker exec -it app bash -c "cat /etc/resolv.conf"
docker exec -it app bash -c "wget -O - -v https://github.com/discourse/logster.git/ |wc"