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 ...
随机推荐
- [天线原理及设计>基本原理] 3. 辐射方向图或天线方向图
<Antenna_Theory_Analysis_and_Design_3rd_Constantine_A._Balanis.pdf> 3. 辐射方向图或天线方向图 天线辐射方向图或天线方 ...
- macOS 磁盘设备文件命名规则
macOS 系统使用不同于 Linux 的磁盘设备命名规则.在 macOS 中,磁盘设备和分区被命名并通过 /dev 目录访问,类似于 Linux 和 UNIX 系统.但是,macOS的命名规则遵循特 ...
- 将文件的换行符由 CRLF 转换为 LF
在 DOS/Windows 文本文件中,换行,也称为新行,是两个字符的组合:回车(CR)后跟一个换行(LF).在 Unix 文本文件中,一行的换行是单个字符:换行(LF).在 Mac 文本文件中,在 ...
- DASCTF 2024暑期挑战赛 RE
DASCTF 2024暑期挑战赛 DosSnake 使用ghidra看反汇编 发现有XOR操作 在ida里面看汇编跟一下 字符DASCTF地址往下6个存放的数据与DASCTF字符串进行异或 A=[0x ...
- jstack排查cpu占用高的步骤
通过jstack排查cpu占用高的问题 1.通过top命令找到cpu占用高的应用程序进程 2.通过top -H -p pid查看该应用中占用CPU高的线程. 3.通过printf "%x\n ...
- 有哪些让你「 爽到爆炸 」的 Windows 软件?
前言 本文源于知乎的一个提问,如标题所示:有哪些让你「 爽到爆炸 」的 Windows 软件?今天大姚给大家分享6款C#/.NET开源且免费的Windows软件,希望可以帮助大家提高学习.开发.办公效 ...
- rpm -Uvh *.rpm --nodeps --force
rpm -Uvh *.rpm --nodeps --force 含义:-U:升级软件,若未软件尚未安装,则安装软件.-v:表示显示详细信息.-h:以"#"号显示安装进度.--for ...
- 鸿蒙(HarmonyOS)实现隐私政策弹窗
在实现用户协议弹窗时,通常我们会想到使用系统自定义弹窗,并在弹窗中点击跳转到Web页面.但在HarmonyOS中,由于系统弹窗的显示优先级高于其他组件,即使跳转到Web页面,弹窗依然会显示在最上层. ...
- iOS中委托使用小结
1.声明委托对象,并根据需要设置方法为可选还是必选,默认设置可选@optional @protocol CCHighSeasPoolDistributeDelegate <NSObject> ...
- C++ 第四节课 C和C++指针的区别 C的宏函数和C++内联函数的优缺点
#include <iostream> // 定义一个宏函数 #define ADD(x,y) x+y; // 宏函数具有速度快等特点 但是写代码有些业务比较繁琐,所以C++中使用了内联函 ...