Use git clone in Docker to report an error Could not resolve host: github.com; Unknown error

created at 11-01-2021 views: 2

In the environment where docker is located, such as centos execute:

1. Modify resolv.conf

vim /etc/resolv.conf

Modify the original nameserver

nameserver 8.8.8.8

2. Restart docker

service docker restart

Into the container:

Execute test

curl www.google.com
Please log in to leave a comment.