docker search mysql Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docke

1.docker search mysql 報錯mysql

[root@localhost usr]# docker search mysql
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?sql

解決:
進入/etc/dockerdocker

查看有沒有 daemon.json。這是docker默認的配置文件。json

 

若是沒有新建,若是有,則修改。unix

[root@localhost docker]# vi daemon.jsonrest

{配置

「registry-mirrors」:
[「https://registry.docker-cn.com」]service

}配置文件

保存退出。文件

查看:

[root@localhost docker]# cat daemon.json

重啓docker服務

service docker restart

相關文章
相關標籤/搜索