连接私有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 私有仓库时报错的更多相关文章

  1. Docker Harbor私有仓库部署与管理 (超详细配图)

    Docker Harbor私有仓库部署与管理 1.Harbor 介绍 2.Harbor部署 3.Harbor管理 1.Harbor 介绍: 什么是 Harbor ? Harbor 是 VMware 公 ...

  2. 菜鸟系列docker——搭建私有仓库harbor(6)

    docker 搭建私有仓库harbor 1. 准备条件 安装docker sudo yum update sudo yum install -y yum-utils device-mapper-per ...

  3. 部署Nexus作为docker的私有仓库

    目录 Docker搭建Nexus私有仓库... 1 一.安装部署... 1 1.安装... 2 2.访问网页端... 2 二.配置使用... 2 1.创建本地仓库... 2 2.docker配置... ...

  4. Python Docker 查看私有仓库镜像【转】

    文章来源:python Docker 查看私有仓库镜像 pip 安装: # 首先安装epel扩展源: yum -y install epel-release # 更新完成之后,就可安装pip: yum ...

  5. Docker 搭建私有仓库

    Docker 搭建私有仓库 环境: docker 版本 :18.09.1 主机地址:192.168.1.79 1.运行并创建私有仓库 docker run -d \ -v /opt/registry: ...

  6. Docker registry 私有仓库镜像查询、删除、上传、下载 shell

    #Docker官方私有仓库registry #官方只提供了API接口,不方便使用,就写了个shell #docker-registry安装配置http://www.cnblogs.com/elvi/p ...

  7. Docker本地私有仓库实战

    Docker仓库主要用于存放Docker镜像,Docker仓库分为公共仓库和私有仓库,基于registry可以搭建本地私有仓库,使用私有仓库的优点如下: 1)节省网络带宽,针对于每个镜像不用去Dock ...

  8. [Docker]docker搭建私有仓库(ssl、身份认证)

    docker搭建私有仓库(ssl.身份认证) 环境:CentOS 7.Docker 1.13.1 CentOS 7相关: https://www.cnblogs.com/ttkl/p/11041124 ...

  9. docker上传私有仓库报错

    docker 1.17 版本搭建私有仓库,上传镜像报错:server gave HTTP response to HTTPS client” 系统环境:centos7docker版本:1.17(注意版 ...

  10. Docker:私有仓库registry [十一]

    一.运行docker私有仓库 安装registry docker run -d -p 5000:5000 --restart=always --name registry -v /opt/myregi ...

随机推荐

  1. 开发一个MutatingWebhook

    介绍 Webhook就是一种HTTP回调,用于在某种情况下执行某些动作,Webhook不是K8S独有的,很多场景下都可以进行Webhook,比如在提交完代码后调用一个Webhook自动构建docker ...

  2. CSS学习(四)值和单位

    一.关键字.字符串和其它文本值 关键字:与其它编程语言一样,是代表特定含义的一个单词( 接收关键字的属性,所取的关键字必须在那个属性允许使用的关键字范围之内 ) 字符串:前后引号要保持一致( 可以是单 ...

  3. AutoMaper使用

    使用 AutoMapper 进行赋值 一. 什么是 AutoMapper AutoMapper是对象到对象的映射工具.在完成映射规则之后,AutoMapper可以将源对象转换为目标对象. 二. Aut ...

  4. C# 全局异常捕获(转载)

    C# 全局异常捕获 原文地址:https://www.cnblogs.com/tomahawk/articles/5993874.html 开发界有那么一个笑话,说是"「我爱你」三个字,讲出 ...

  5. C 语言头文件作用的简单理解

    C 语言是一种先声明后使用的语言. 举个例子: 如果你要在 main() 函数里调用一个你的函数 foo(),那么你有两种写法: 将 foo() 的定义写在 main() 之前.此时 foo() 的声 ...

  6. mysql修改编码utf8

    摘要:使用apt-get 命令安装的mysql默认不是utf8.在这里记录一下如何将编码修改成utf8. Linux学习笔记之--ubuntu中mysql修改编码utf8 一:查看mysql版本 1. ...

  7. Playwright 源码 BrowserType

    playwright-java 的 Browser.BrowserContext.Page 挺好理解的,唯独这厮,就有一丢丢 -- package com.microsoft.playwright; ...

  8. 如何在 Nuxt 3 中有效使用 TypeScript

    title: 如何在 Nuxt 3 中有效使用 TypeScript date: 2024/9/9 updated: 2024/9/9 author: cmdragon excerpt: 摘要:本文详 ...

  9. 使用js闭包实现可取消的axios请求

    在平常开发中,经常会遇到重复请求的情况,也许是因为网络问题,也许是因为接口问题等等,传统做法是客户端采用防抖来限制用户发送接口的频率,一般出个loading转圈圈的形式, 但是很少使用取消请求的做法, ...

  10. ASP.NET Core – ADO.NET

    前言 自从用 Entity Framework 就再也没有用过 ADO.NET 了. 很多年前写过 基础 ADO.NET 访问MYSQL 与 MSSQL 数据库例子. 今天刚好想做个单侧, 那就顺便翻 ...