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 ...
随机推荐
- OpenHarmony编译构建系统详解,从零搭建windows下开发环境,巨方便!
自从OpenHarmony更新了dev-tool,就可以在windows下构建鸿蒙(轻量型)系统了,这对于进行MCU开发的朋友们,学习鸿蒙OS会友好许多!我们可以更快的构建出系统,方便快速学习和验证. ...
- python开发环境安装-包含Anaconda的安装配置和pycharm的安装
一. 需要得安装包 1. Anaconda3-5.3.0-Windows-x86_64.exe python环境 2.pycharm-professional-2021.2.2.exe ...
- 从cmake解决clion编译生成的可执行文件(.exe)不可执行的问题
我这里没有显示报错,是直接闪退的情况,但是网上搜索的时候大多数是有报错弹窗的,运行报错提示为无法链接动态库.如下图: ![原图来自CSDN@LJY_kt11 一句话说清楚 原因是使用CLion编译的程 ...
- vue打包项目版本号自加
原因 项目每次打包后都需要改动项目版本号,这个改动每次都需要在package.json中修改version,比较麻烦,到底有没有一种打包后版本号自加的办法. 方案 版本号自加其实可以使用fs修改文件来 ...
- Flask 从开发到部署
整理一下怎么开发flask程序应部署到生产环境中 1. 第一个flask 程序 myapp.py from flask import Flask app = Flask(__name__) @app. ...
- Webpack4-使用expose-loader将变量注册到全局
首先贴一下 package.json中的插件版本,不同的版本也许会有很大的差异: // package.json{ "name": "WEBPACK-DEV-1" ...
- BOM – Window.matchMedia
参考 Youtube – Detecting Screen Size and OS Dark Mode with matchMedia() - JavaScript Tutorial 介绍 CSS 有 ...
- RSA 对称加密,对称解密----公钥私钥加密解密过程
RSA 对称加密,对称解密----公钥私钥加密解密过程(Java) 公司说不能传铭文密码,所以只能加密,再解密:麻烦事,其实这在需求文档没有,开发时间点也没有,浪费了了一上午的时间,还占用了公司给的开 ...
- QT数据可视化框架编程实战之三维柱状图_补天云QT技术培训专家
QT数据可视化框架编程实战之三维柱状图_补天云QT技术培训专家 文章目录 QT数据可视化框架编程实战:三维柱状图可视化运行效果 主程序实现C++代码 主场景 QML代码 坐标轴QML代码 数据模型定义 ...
- 系统编程-进程-exec系列函数超级详解(带各种实操代码)
我的相关博文: 系统编程-进程-close-on-exec机制 PART1 exec系列函数功能简介 exec系列函数登场 常规操作是先fork一个子进程,然后在子进程中调用exec系列函数执行新的 ...