docker 搭建私有 docker hub
查找registry 镜像
meiya@meiya:/etc/docker$ clear
meiya@meiya:/etc/docker$ docker search registry
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
registry The Docker Registry 2.0 implementation for s… [OK]
konradkleine/docker-registry-frontend Browse and modify your Docker registry in a … [OK]
hyper/docker-registry-web Web UI, authentication service and event rec… [OK]
atcol/docker-registry-ui A web UI for easy private/local Docker Regis… [OK]
distribution/registry WARNING: NOT the registry official image!!! … [OK]
jhipster/jhipster-registry JHipster Registry, based on Netflix Eureka a… [OK]
marvambass/nginx-registry-proxy Docker Registry Reverse Proxy with Basic Aut… [OK]
google/docker-registry Docker Registry w/ Google Cloud Storage driv…
confluentinc/cp-schema-registry Official Confluent Docker Images for Schema …
joxit/docker-registry-ui Docker registry v2 web User Interface [OK]
klausmeyer/docker-registry-browser Web Interface for the Docker Registry HTTP A… [OK]
openshift/origin-docker-registry The integrated OpenShift V3 registry
deis/registry Docker image registry for the Deis open sour…
quiq/docker-registry-ui Docker Registry UI
landoop/schema-registry-ui UI for Confluent's Schema Registry 7 [OK]
parabuzzle/docker-registry-ui Docker registry frontend for registry v2
anoxis/registry-cli You can list and delete tags from your priva… [OK]
elasticio/docker-registry-ecs Docker image to run Docker private registry … [OK]
allingeek/registry A specialization of registry: configured fo… [OK]
yammer/docker-registry-cache Simple docker registry cache using squid-pro… [OK]
webhippie/registry Docker images for Docker Registry [OK]
aibaars/docker-registry2-gcs Docker Registry2 w/ Google Cloud Storage dri…
convox/registry
lorieri/registry-ceph Ceph Rados Gateway (and any other S3 compati…
torchbox/kube-registry-proxy kube-registry-proxy fork with correct timeou… [OK]
拉取registry镜像
meiya@meiya:/etc/docker$ docker pull registry
Using default tag: latest
latest: Pulling from library/registry
c87736221ed0: Pull complete
1cc8e0bb44df: Pull complete
54d33bcb37f5: Pull complete
e8afc091c171: Pull complete
b4541f6d3db6: Pull complete
Digest: sha256:3b00e5438ebd8835bcfa7bf5246445a6b57b9a50473e89c02ecc8e575be3ebb5
Status: Downloaded newer image for registry:latest
查看镜像
meiya@meiya:/etc/docker$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
registry latest f32a97de94e1 months ago .8MB
docker 镜像删除后会把所有的数据和文件都删除,所以要把宿主机的本地目录挂载到registry容器内部的目录上,在删除registry容器后依旧能保证文件和数据不丢失
meiya@meiya:/etc/docker$ mkdir -p ~/docker/data/registry
meiya@meiya:/etc/docker$ cd /
bin/ cdrom/ etc/ lib/ lost+found/ mnt/ proc/ run/ snap/ sys/ usr/
boot/ dev/ home/ lib64/ media/ opt/ root/ sbin/ srv/ tmp/ var/
meiya@meiya:/etc/docker$ cd /
bin/ cdrom/ etc/ lib/ lost+found/ mnt/ proc/ run/ snap/ sys/ usr/
boot/ dev/ home/ lib64/ media/ opt/ root/ sbin/ srv/ tmp/ var/
meiya@meiya:/etc/docker$ cd ~/docker/data/registry/
meiya@meiya:~/docker/data/registry$ pwd
/home/meiya/docker/data/registry
meiya@meiya:~/docker/data/registry$
创建registry镜像容器,绑定5000端口
meiya@meiya:~/docker/data/registry$ docker run -d -p : -v /home/meiya/docker/data/registry:/tmp/registry registry
0a922d940f7c9d7c4c3e4d81caaf3d5582e34fbb49e2824675b4c43b652e3240
meiya@meiya:~/docker/data/registry$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0a922d940f7c registry "/entrypoint.sh /etc…" seconds ago Up seconds 0.0.0.0:->/tcp nifty_ganguly
meiya@meiya:~/docker/data/registry$ netstat -ntlp | grep
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp6 ::: :::* LISTEN -
meiya@meiya:~/docker/data/registry$ telnet 192.168.1.57
Trying 192.168.1.57...
Connected to 192.168.1.57.
Escape character is '^]'.
q
HTTP/1.1 Bad Request
Content-Type: text/plain; charset=utf-
Connection: close Bad RequestConnection closed by foreign host.
meiya@meiya:~/docker/data/registry$
将本地的镜像加上tag , 然后上传私服
meiya@meiya:~/docker/data/registry$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
tomcat latest 27600aa3d7f1 hours ago 463MB
registry latest f32a97de94e1 months ago .8MB
meiya@meiya:~/docker/data/registry$ docker tag tomcat 192.168.1.57:/tomcat
meiya@meiya:~/docker/data/registry$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
192.168.1.57:/tomcat latest 27600aa3d7f1 hours ago 463MB
tomcat latest 27600aa3d7f1 hours ago 463MB
registry latest f32a97de94e1 months ago .8MB
meiya@meiya:~/docker/data/registry$ docker push 192.168.1.57:/tomcat
The push refers to repository [192.168.1.57:/tomcat]
Get https://192.168.1.57:5000/v2/: http: server gave HTTP response to HTTPS client
meiya@meiya:~/docker/data/registry$
这里出了个问题 ,主要是因为docker新版本默认不支持https协议,开放https协议
Get https://192.168.1.57:5000/v2/: http: server gave HTTP response to HTTPS client
解决办法,修改docker的配置文件,
修改默认的配置文件
sudo vi /etc/default/docker
加入
DOCKER_OPTS="--registry-mirror=https://registry.docker-cn.com --insecure-registry=192.168.1.57:5000"
# Docker Upstart and SysVinit configuration file #
# THIS FILE DOES NOT APPLY TO SYSTEMD
#
# Please see the documentation for "systemd drop-ins":
# https://docs.docker.com/engine/admin/systemd/
# # Customize location of Docker binary (especially for development testing).
#DOCKERD="/usr/local/bin/dockerd" # Use DOCKER_OPTS to modify the daemon startup options.
#DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4" DOCKER_OPTS="--registry-mirror=https://registry.docker-cn.com --insecure-registry=192.168.1.57:5000" # If you need Docker to use an HTTP proxy, it can also be specified here.
#export http_proxy="http://127.0.0.1:3128/" # This is also a handy place to tweak where Docker's temporary files go.
#export DOCKER_TMPDIR="/mnt/bigdrive/docker-tmp"
重启docker服务, 重启registry容器,重新push本地镜像
meiya@meiya:~/docker/data/registry$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
meiya@meiya:~/docker/data/registry$ docker run -d -p 5000:5000 -v /home/meiya/docker/data/registry:/tmp/registry registry
5b48b4c0147ceb6b7fec52943cd38420ac61ae488089326ff5b956b7c566f69e
meiya@meiya:~/docker/data/registry$ docker push 192.168.1.57:5000/tomcat
The push refers to repository [192.168.1.57:5000/tomcat]
d0830810b081: Pushed
32cddd6bb4cf: Pushed
f0e1731fd286: Pushed
2b6c38ff3137: Pushed
d38f3d5a39fb: Pushed
fe60061c6c4e: Pushed
7d63f8777ebf: Pushed
1b958b53b256: Pushed
2c719774c1e1: Pushed
ec62f19bb3aa: Pushed
f94641f1fe1f: Pushed
latest: digest: sha256:b3e89c95260685b18b31acb078b168c30a3b94ba561801bf374ccec0e7c622c6 size: 2626
ps:
第二种办法是修改 /etc/docker/daemon.json 文件,重启docker服务, 重启registry容器,重新push本地镜像
meiya@meiya:~/docker/data/registry$ cat /etc/docker/daemon.json
{
"registry-mirrors": ["https://hdokp13m.mirror.aliyuncs.com"],
"insecure-registries":["192.168.1.57:5000"],
"registry-mirrors": ["https://registry.docker-cn.com"]
}
查看私有仓库中的镜像
meiya@meiya:~/docker/data/registry$ curl get http://192.168.1.57:5000/v2/_catalog
curl: (6) Could not resolve host: get
{"repositories":["tomcat"]}
ps:
部分旧的docker版本使用的地址是 http://192.168.1.57:5000/v2/_search
从私有仓库下载镜像
meiya@meiya:~/docker/data/registry$ docker pull 192.168.1.57:/tomcat
Using default tag: latest
latest: Pulling from tomcat
Digest: sha256:b3e89c95260685b18b31acb078b168c30a3b94ba561801bf374ccec0e7c622c6
Status: Image is up to date for 192.168.1.57:/tomcat:latest
docker 搭建私有 docker hub的更多相关文章
- 温故知新,基于Nexus3和Docker搭建私有Docker Mirrors镜像库
前言 接着上一篇文章关于基于Nexus3和Docker搭建私有Nuget服务的探索,我们可以进一步利用Nexus3来创建一个私有的Docker镜像库满足内部需求. 仓库类型 hosted: 本地存储, ...
- 菜鸟系列docker——搭建私有仓库harbor(6)
docker 搭建私有仓库harbor 1. 准备条件 安装docker sudo yum update sudo yum install -y yum-utils device-mapper-per ...
- Docker 搭建私有仓库
Docker 搭建私有仓库 环境: docker 版本 :18.09.1 主机地址:192.168.1.79 1.运行并创建私有仓库 docker run -d \ -v /opt/registry: ...
- [Docker]docker搭建私有仓库(ssl、身份认证)
docker搭建私有仓库(ssl.身份认证) 环境:CentOS 7.Docker 1.13.1 CentOS 7相关: https://www.cnblogs.com/ttkl/p/11041124 ...
- docker 搭建私有云仓库
docker搭建私有仓库 registry私有仓库 下载docker-distribution软件包 yum install epel-release yum install docker-dis ...
- 搭建私有Docker Registry
Docker官方提供了用于搭建私有registry的镜像,并配有详细文档. 官方Registry镜像:https://hub.docker.com/_/registry 官方文档:https://do ...
- docker搭建私有registry
搭建docker的私有registry 1. registry简介 Docker在2015年推出了distribution项目,即Docker Registry 2.相比于old registry ...
- Docker搭建私有仓库
1,下载仓库镜像. docker pull registry //主要用于搭建私有仓库的. 2,将宿主机端口映射到容器中去,容器的5000端口是不能更改的. docker run -d -p ...
- [转] 使用HTTPS在Nexus Repository Manager 3.0上搭建私有Docker仓库
FROM: https://www.hifreud.com/2018/06/06/03-nexus-docker-repository-with-ssl/ 搭建方式 搭建SSL的Nexus官方提供两种 ...
随机推荐
- noi.ac #36 模拟
\(des\) 存在 \(1000 \times 1000\) 的矩阵,保证元素互不相同,\(2e5\) 次询问,每次询 问给定 \(x, y\) 问存在多少点 \((a, b)\) 满足该元素是 \ ...
- fft相关的复习
任意长度卷积 CZT 就是一波推导 \[ \begin{aligned} b_i &= \sum_{j=0}^{n-1} \omega^{ij}a_j \\ &= \sum_{j=0} ...
- cometoj---contest#3 棋盘
棋盘:(状压dp) 传送门:https://www.cometoj.com/contest/38/problem/B?problem_id=1535 题目描述 小猫有一个 2×N 的棋盘,每一个格子放 ...
- 如何修复GitKraken Inotify Limit Error\idea erro - 升级Ubuntu / Linux inotify限制
GitKraken是一个非常优秀的Git客户端.如果您是软件开发人员,那么您绝对应该试试GitKraken.今天我去了我的一个存储库做了一些提交,但是GitKraken告诉我它已经得到了Inotify ...
- npropress进度条插件的使用
官网下载地址:http://ricostacruz.com/nprogress/ npropress.css /* Make clicks pass-through */ #nprogress { p ...
- Java与设计模式之单例模式(上)六种实现方式
阎宏博士在<JAVA与模式>中是这样描述单例模式的:作为对象的创建模式,单例模式确保某一个类只有一个实例,而且自行实例化并向整个系统提供这个实例.这个类称为单例类. ...
- SweetAlert 2 全网最详细的使用方法
官网链接 SweetAlert2 官网链接 准备阶段 CDN js 如果该 链接 时间久远了 , 可以在官网去找找最新的 可以把 js 复制出来 自己新建一个文件 然后 引用到 html 中 1. 带 ...
- mnist卷积网络实现
加载MNIST数据 from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_se ...
- Shell登陆远程服务器
现场服务器较多,密码3个月过期,在到期时需更改密码. 使用expect编写,尝试登陆2次后退出(防止密码错误时账号锁定),超时重试一次. shell脚本调用并定时执行,登陆成功后执行一条命令,如:ho ...
- 深度学习面试题13:AlexNet(1000类图像分类)
目录 网络结构 两大创新点 参考资料 第一个典型的CNN是LeNet5网络结构,但是第一个引起大家注意的网络却是AlexNet,Alex Krizhevsky其实是Hinton的学生,这个团队领导者是 ...