使用docker出现的一些问题

 

①无法下载镜像

下载镜像如返回如下信息:

Get https://registry-1.docker.io/v2/: x509: certificate is valid for pss-cep-authtoken.asurionmobile.com, pss-cep-campaignrest.asurionmobile.com, pss-cep-campauto.asurionmobile.com, pss-cep-campaignweb.asurionmobile.com, pss-cep-criterialoader.asurionmobile.com, pss-cep-csvloader.asurionmobile.com, pss-cep-datalookupservice.asurionmobile.com, pss-cep-dbmigrationapi.asurionmobile.com, pss-cep-deviceregister.asurionmobile.com, pss-cep-dynamicdataapi.asurionmobile.com, pss-cep-enrollmentfeedprocesor.asurionmobile.com, pss-cep-eventforapi.asurionmobile.com, pss-cep-gatewayapi.asurionmobile.com, pss-cep-history-api.asurionmobile.com, pss-cep-jobreader.asurionmobile.com, pss-cep-notificationapi.asurionmobile.com, pss-cep-preferencesapi.asurionmobile.com, pss-cep-refloader.asurionmobile.com, pss-cep-servertemplateprocessor.asurionmobile.com, pss-cep-ssloader.asurionmobile.com, pss-cep-schedulerapi.asurionmobile.com, pss-cep-smsgatewayapi.asurionmobile.com, pss-dis-supportviewapi.asurionmobile.com, not registry-1.docker.io

 

解决办法:

openssl genrsa -out client.key 4096

openssl req -new -x509 -text -key client.key -out client.key

mv client.* /usr/local/share/ca-certificate

systemctl restart docker

 

前端时间更新了openssl,可能是这个原因导致的,具体原因以后再分析。

 

②Cannot connect to the Docker daemon at tcp://localhost:2375. Is the docker daemon running?

#一次性的,不设置DOCKER_HOST
unset DOCKER_HOST


vi ~/.bashrc
# 在最下面添加一行:
export DOCKER_HOST='unix:///var/run/docker.sock'
source .bashrc

 

③docker部署服务报:WARNING:IPv4 forwarding is disabled. Networking will not work.

vi /etc/sysctl.conf

# 开启路由功能
net.ipv4.ip_forward=1

# 重启network服务
systemctl restart network && systemctl restart docker

#查看是否修改成功 (备注:返回1,就是成功)
[root@docker-node2 ~]# sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1

 

posted @ 2020-01-08 17:38  MegaloBox  阅读(807)  评论(0编辑  收藏  举报