0%

Docker添加私有镜像库

因为当初双系统给Linux分配硬盘小了~ 可悲的是镜像沾满了所有硬盘.索性全部全盘全格式化了从新安装了.(没有备份,各种文件找不到)但是发现一个问题.忘了私有镜像库的配制方法...好吧原谅我老了健忘...
1
2
3
public static void main(String[] args){
System.out.println("je")
}
1
2
3
//修改这个文件.
$ /etc/defaults/docker
DOCKER_OPTS="$DOCKER_OPTS --registry-mirror=registry.domain.org"
1
2
3
4
registry.domain.org/elk/elasticsearch:latest
Error response from daemon: invalid registry endpoint https://registry.domain.org/v0/: unable to ping registry endpoint https://registry.domain.org/v0/
v2 ping attempt failed with error: Get https://registry.domain.org/v2/: x509: certificate signed by unknown authority
v1 ping attempt failed with error: Get https://registry.domain.org/v1/_ping: x509: certificate signed by unknown authority. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry registry.domain.org` 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/registry.domain.org/ca.crt

上面写的很明白了~ https~ 但是我没有证书.翻箱倒柜.终于找到当初生成的证书…但是需要放在/etc/docker/certs.d/registry.domain.org/目录下的 ca.crt文件
这里貌似必须用 root 用户新建这个文件.然后拷贝你的证书内容进去,别问我为什么.我也不知道…

捂脸望天