系统环境 查看 文章末尾 附录

问题点:新建local registry后,push新的image到local registry  未能成功,并报错误:

The push refers to repository [ip:/horizon2007/httpd] Get https://IP:5000/v2/: http: server gave HTTP response to HTTPS client 

查阅文档:https://docs.docker.com/registry/insecure/

解决方法:

  在/etc/hosts中添加: (192.168.184.130为本机IP)

root@localhost:/etc/docker# echo "192.168.184.130 hub.docker.horizon.io" >> /etc/hosts

  在/etc/docker/daemon.json中添加一条:

{
"registry-mirrors": ["http://5a9b2e97.m.daocloud.io"],
"insecure-registries": ["hub.docker.horizon.io:5000"]
}

重启

service docker restart

再次推送到本地registry:

root@localhost:/etc/docker# docker push hub.docker.horizon.io:5000/httpd:v2.2
The push refers to repository [hub.docker.horizon.io:5000/httpd]
ab5efd5aec77: Pushed
9058feb62b4a: Pushed
3f7f50ced288: Pushed
71436bd6f1c4: Pushed
4bcdffd70da2: Pushed
v2.2: digest: sha256:558680adf8285edcfe4813282986eb7143e3c372610c6ba488723786bd5b34c5 size: 1366

--------------------------------------------

附录:系统环境 

Client:
Version: 18.06.-ce
API version: 1.38
Go version: go1.10.3
Git commit: 0ffa825
Built: Wed Jul ::
OS/Arch: linux/amd64
Experimental: false Server:
Engine:
Version: 18.06.-ce
API version: 1.38 (minimum version 1.12)
Go version: go1.10.3
Git commit: 0ffa825
Built: Wed Jul ::
OS/Arch: linux/amd64
Experimental: false

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04 LTS"

root@localhost:/etc/docker# docker info
Containers:
Running:
Paused:
Stopped:
Images:
Server Version: 18.06.-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: d64c661f1d51c48782c9cec8fda7604785f93587
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.4.--generic
Operating System: Ubuntu 16.04 LTS
OSType: linux
Architecture: x86_64
CPUs:
Total Memory: .95GiB
Name: horizon-virtual-machine
ID: FRRK:DIDH:XQDM:VHNJ:XVLQ:ZPPM:CWQZ:KSR3:5KN4:LEYM:2HWG:R2KL
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: horizon2007
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/
Registry Mirrors:
http://5a9b2e97.m.daocloud.io/
Live Restore Enabled: false

最新文章

  1. C++与C的指针的不同
  2. [系统开发] Python 实现的 Bind 智能 DNS Web 管理系统
  3. Ubuntu12.04配置mod_python
  4. jquery json ajax -2
  5. Eclipse和Android Studio中的DDMS使用时什么不同?
  6. 20141030--SQL2008常用命令-1
  7. Base64加密
  8. java中的toString方法
  9. C# Delegate 异步调用
  10. javascript summary
  11. ISO C Random Number Functions
  12. 一道python面试题引发的血案
  13. 图像处理------颜色梯度变化 (Color Gradient)
  14. Django 序列化
  15. Django Restframework 过滤器
  16. 42 【docker】run命令
  17. 1.2万事开头hello world+交互+getpass、sys模块初识
  18. spring使用BeanPostProcesor实现AOP源码分析
  19. ESP8266 上线
  20. linux编译安装php apache mysql (已试过)

热门文章

  1. selenium3 文件系列之------读取properties文件
  2. django的templatetags
  3. openjdk for window
  4. securecrt通过ssh连接板子: 密钥交换失败,没有兼容的加密程序
  5. SpringBoot(十二):springboot2.0.2写测试用例
  6. 安装了 R2 Integration Servic 之后,SQL Server 2008 Management Studio报错
  7. 删除 nuget 文件夹内容
  8. Python之数学题目练习
  9. python 验证码识别示例(二) 复杂验证码识别
  10. Form 组件的学习