Ubuntu 19.10中Docker安装和配置国内源

Ubuntu 19.10中Docker安装和配置国内源

Docker安装

sudo apt-get install docker.io

安装好了之后,在使用过程中可能会存在一下错误。

以下问题加 sudo可解决

docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
See ‘docker run --help’.

以下问题为docker配置国内源可解决。

Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/scrapinghub/splash/manifests/latest: Get https://auth.docker.io/token?scope=repository%3Ascrapinghub%2Fsplash%3Apull&service=registry.docker.io: net/http: TLS handshake timeout

Docker配置国内源

# 增加或创建/etc/docker/daemon.json
vim /etc/docker/daemon.json

在/etc/docker/daemon.json中增加一下代码,以下为配置阿里源

{
 "registry-mirrors":["https://6kx4zyno.mirror.aliyuncs.com"]
}
发布了25 篇原创文章 · 获赞 23 · 访问量 3004

猜你喜欢

转载自blog.csdn.net/weixin_42856871/article/details/104739564