首先问题描述:在对局域网内进行docker pull时提示:
-
Error response from daemon: invalid registry endpoint https://192.168.15.108:5000/v0/: unable to ping registry endpoint https://192.168.15.108:5000/v0/
-
v2 ping attempt failed with error: Get https://192.168.15.108:5000/v2/: tls: oversized record received with length 20527
-
v1 ping attempt failed with error: Get https://192.168.15.108:5000/v1/_ping: tls: oversized record received with length 20527. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry 192.168.15.108:5000` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/192.168.15.108:5000/ca.crt
原因是:在通过http方式进行pull时,无法使用证书导致。
解决办法:<1>vi /etc/sysconfig/docker(有的系统会在
/etc/default/docker下,据有少些人说安装完后这个配置文件跑到了/usr/lib下,不过都无所谓)
<2>将第四行OPTIONS='--selinux-enabled' 注释掉(此举将省去修改/etc/sysconfig/selinux中第七行的SELINUX=enforcing为disabled
)
<3> 将低23行#INSECURE_REGISTRY='--insecure-registry' 的#号去掉,并在registry后添加上服务器指定域名或者Ip+端口号,例如:
INSECURE_REGISTRY='--insecure-registry 192.168.15.108:5000'
<4>wq保存退出, service docker restart 即可解决。
docker安装(centos):
确认好yum源可用,执行 yum install docker即可 (测试发现yum install docker-io效果一样 , -y的话是安装过程中出现的提示全部默认yes)
docker启动:
方式一: 手动启动 。直接执行/usr/bin/docker -d --insecure-registry 192.168.15.108:5000
(注意我这里是为了从局域网服务器上pull一个镜像才执行的
--insecure-registry 192.168.15.108:5000,否则会报开头出现的错误, 当然你也可以执行类似于/usr/bin/docker -d --selinux-enabled直接从docker官网选择已有的镜像自己去Pull. 再当然,此时就需要一些类似于docker search的操作,以便选择更为精确的镜像版本,具体参考这个)
方式二:通过一开头出现问题时,修改的配置文件,执行service docker start ,来启动服务。
docker确认启动: ps -ef | grep docker时,能够看到
[root@localhost ming]# ps -ef |grep docker
root 22683 1 0 14:01 ? 00:00:00 /usr/bin/docker -d --selinux-enabled
root 22825 13681 0 14:06 pts/0 00:00:00 grep --color=auto docker
执行docker info
-
-
[root@localhost ming]# docker info
-
Containers: 0
-
Images: 12
-
Storage Driver: devicemapper
-
Pool Name: docker-253:1-5918542-pool
-
Pool Blocksize: 65.54 kB
-
Backing Filesystem: xfs
-
Data file: /dev/loop0
-
Metadata file: /dev/loop1
-
Data Space Used: 823.5 MB
-
Data Space Total: 107.4 GB
-
Data Space Available: 40.81 GB
-
Metadata Space Used: 1.315 MB
-
Metadata Space Total: 2.147 GB
-
Metadata Space Available: 2.146 GB
-
Udev Sync Supported: true
-
Deferred Removal Enabled: false
-
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
-
Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
-
Library Version: 1.02.93-RHEL7 (2015-01-28)
-
Execution Driver: native-0.2
-
Logging Driver: json-file
-
Kernel Version: 3.10.0-123.el7.x86_64
-
Operating System: CentOS Linux 7 (Core)
-
CPUs: 2
-
Total Memory: 1.791 GiB
-
Name: localhost.localdomain
-
ID: YZPN:3IYO:WQPB:53ID:2QB2:O2RA:LMMP:XC2N:A47O:ENUB:WUZD:DPQS
执行docker version
-
[root@localhost ming]# docker version
-
Client version: 1.7.1
-
Client API version: 1.19
-
Package Version (client): docker-1.7.1-115.el7.x86_64
-
Go version (client): go1.4.2
-
Git commit (client): 446ad9b/1.7.1
-
OS/Arch (client): linux/amd64
-
Server version: 1.7.1
-
Server API version: 1.19
-
Package Version (server): docker-1.7.1-115.el7.x86_64
-
Go version (server): go1.4.2
-
Git commit (server): 446ad9b/1.7.1
-
OS/Arch (server): linux/amd64
此时我们就可以先从本地pull一个镜像文件进行各种操作了
具体的各种pull方式 ,参考 />
阅读(2475) | 评论(0) | 转发(0) |