docker login 私有仓库时报错
连接私有harbor报错如下:
docker login 192.168.1.88 -uadmin -pHarbor12345
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: Get "https://192.168.1.88/v2/": x509: cannot validate certificate for 192.168.1.88 because it doesn't contain any IP SANs
解决办法:
1、在/etc/docker/daemon.json中添加私有仓库地址
{
"insecure-registries":["192.168.1.88"],
"registry-mirrors":["https://rsbud4vc.mirror.aliyuncs.com","https://registry.docker-cn.com","https://docker.mirrors.ustc.edu.cn","https://dockerhub.azk8s.cn","http://hub-mirror.c.163.com","http://qtid6917.mirror.aliyuncs.com", "https://rncxm540.mirror.aliyuncs.com"],
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver":"json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver":"overlay2",
"storage-opts": [
"overlay2.override_kernel_check=true"
]
}
部分参数(registry-mirrors、insecure-registries ...)修改,只要reconfigure(systemctl reload docker) 就生效
"registry-mirrors": ["https://8f6a79wk.mirror.aliyuncs.com"] # 镜像加速地址
"insecure-registries":["私库地址"] # Docker如果需要从非SSL源管理镜像,这里加上。
2、在/usr/lib/systemd/system/docker.service中添加私有仓库地址
--insecure-registry=https://192.168.1.88
cat /usr/lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target docker.socket firewalld.service containerd.service
Wants=network-online.target
Requires=docker.socket containerd.service
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --insecure-registry=https://192.168.1.88
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always
# Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229.
# Both the old, and new location are accepted by systemd 229 and up, so using the old location
# to make them work for either version of systemd.
StartLimitBurst=3
# Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230.
# Both the old, and new name are accepted by systemd 230 and up, so using the old name to make
# this option work for either version of systemd.
StartLimitInterval=60s
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Comment TasksMax if your systemd version does not support it.
# Only systemd 226 and above support this option.
TasksMax=infinity
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
OOMScoreAdjust=-500
[Install]
WantedBy=multi-user.target
重启docker服务
systemctl daemon-reload
systemctl restart docker
3.检查本地hosts文件
报错:
docker login 192.168.1.88 -u admin -pHarbor12345
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: Get "https://192.168.1.88/v2/": Get "https://dockerhub/service/token?account=admin&client_id=docker&offline_token=true&service=harbor-registry": dial tcp: lookup dockerhub on 114.114.114.114:53: no such host
检查部署harbor服务的机器配置文件:
cat harbor.cfg |grep -v "#"|grep hostname
hostname = dockerhub
修改本地hosts文件:
cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.88 dockerhub
docker login 私有仓库时报错的更多相关文章
- Docker Harbor私有仓库部署与管理 (超详细配图)
Docker Harbor私有仓库部署与管理 1.Harbor 介绍 2.Harbor部署 3.Harbor管理 1.Harbor 介绍: 什么是 Harbor ? Harbor 是 VMware 公 ...
- 菜鸟系列docker——搭建私有仓库harbor(6)
docker 搭建私有仓库harbor 1. 准备条件 安装docker sudo yum update sudo yum install -y yum-utils device-mapper-per ...
- 部署Nexus作为docker的私有仓库
目录 Docker搭建Nexus私有仓库... 1 一.安装部署... 1 1.安装... 2 2.访问网页端... 2 二.配置使用... 2 1.创建本地仓库... 2 2.docker配置... ...
- Python Docker 查看私有仓库镜像【转】
文章来源:python Docker 查看私有仓库镜像 pip 安装: # 首先安装epel扩展源: yum -y install epel-release # 更新完成之后,就可安装pip: yum ...
- Docker 搭建私有仓库
Docker 搭建私有仓库 环境: docker 版本 :18.09.1 主机地址:192.168.1.79 1.运行并创建私有仓库 docker run -d \ -v /opt/registry: ...
- Docker registry 私有仓库镜像查询、删除、上传、下载 shell
#Docker官方私有仓库registry #官方只提供了API接口,不方便使用,就写了个shell #docker-registry安装配置http://www.cnblogs.com/elvi/p ...
- Docker本地私有仓库实战
Docker仓库主要用于存放Docker镜像,Docker仓库分为公共仓库和私有仓库,基于registry可以搭建本地私有仓库,使用私有仓库的优点如下: 1)节省网络带宽,针对于每个镜像不用去Dock ...
- [Docker]docker搭建私有仓库(ssl、身份认证)
docker搭建私有仓库(ssl.身份认证) 环境:CentOS 7.Docker 1.13.1 CentOS 7相关: https://www.cnblogs.com/ttkl/p/11041124 ...
- docker上传私有仓库报错
docker 1.17 版本搭建私有仓库,上传镜像报错:server gave HTTP response to HTTPS client” 系统环境:centos7docker版本:1.17(注意版 ...
- Docker:私有仓库registry [十一]
一.运行docker私有仓库 安装registry docker run -d -p 5000:5000 --restart=always --name registry -v /opt/myregi ...
随机推荐
- VIM正则替换行尾
https://nfcwar.lofter.com/post/1d1ee5d7_670890a 替换/删除某个字符后面的所有内容::%s/b.*/c/g 删除b后面所有的字符,以c替换.用g表示全 ...
- STM32F3, STM32F4编程手册
1. Cortex-M4的内核设备 NVIC, Nested vectored interrupt controller SCB, System control block SysTick, The ...
- 7E头的那些事儿(帧格式分析实例)
0. 前言 作为一名嵌入式工程师,经常需要通过UART与外设打交道,而对于串行总线来说,往往我们必须要进行帧同步.通常的做法是把信令包含在2个0x7E的中间. 除此之外还有HDLC.PPP等协议也会到 ...
- 使用sl+tmux哇娃
0x01 背景 2岁多的小娃不肯刷牙,有时看故事书时会配合刷一会儿,但偶尔也不好使.突然想到TA,之前在电脑桌旁边捣乱时,给ta看过console中的小火车,ubuntu中安装sl命令后就可以看到,用 ...
- IP报文格式详解
下图为常见的IP报文格式表: 上面是IP的报文格式,接下来我们先说明各个字段的意义.然后,用Etheral软件转包分析IP的报文格式. 1.版本:ip报文中,版本占了4位,用来表示该协议采用的是那一个 ...
- Vue状态管理库Pinia详解
Pinia 是 Vue 的状态管理库,它提供了一种更简单.更不规范的 API 来管理应用的状态.Pinia 的设计哲学是简单性和易用性,它避免了 Vuex 中的许多复杂概念,如 mutations 和 ...
- Docker网络上篇-网络介绍
通过前面的学习,我们已经可以把自己写的微服务项目通过dockerfile文件方式部署到docker上面了.那么微服务之间通信,怎么通信的?是在同一个网络还是在不同的网络环境下?docker中怎么配置网 ...
- 补: Rest 风格请求处理的的内容补充(1)
补: Rest 风格请求处理的的内容补充(1) Rest风格请求:注意事项和细节 客户端是PostMan 可以直接发送Put,delete等方式请求,可不设置Filter 如果哟啊SpringBoot ...
- Unity中的三种渲染路径
Unity中的渲染路径 Unity的渲染路径 在Unity里,渲染路径(Rendering Path)决定了光照是如何应用到Unity Shader中的.因此,我们只有为Shader正确地选择和设置了 ...
- BOOST <boost/asio.hpp> 奇怪的编译错误 boost/asio/detail/consuming_buffers.hpp:105:65: error
在我的项目工程代码内#include <boost/asio.hpp>后导致了编译报错: ./include/boost/asio/detail/consuming_buffers.hpp ...