国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看av不卡

服務器之家:專注于服務器技術及軟件下載分享
分類導航

云服務器|WEB服務器|FTP服務器|郵件服務器|虛擬主機|服務器安全|DNS服務器|服務器知識|Nginx|IIS|Tomcat|

服務器之家 - 服務器技術 - 服務器知識 - 使用Docker registry鏡像創建私有倉庫的方法

使用Docker registry鏡像創建私有倉庫的方法

2021-01-21 17:52delphiwcdj 服務器知識

本篇文章主要介紹了使用Docker registry鏡像創建私有倉庫的方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下。

安裝Docker后,可以通過官方提供的registry鏡像來簡單搭建一套本地私有倉庫環境,本文記錄簡單的搭建過程。

1 使用registry啟動私有倉庫的容器

?
1
docker run -d -p 5000:5000 -v /root/my_registry:/tmp/registry registry

說明:若之前沒有安裝registry容器則會自動下載并啟動一個registry容器,創建本地的私有倉庫服務。默認情況下,會將倉庫創建在容器的/tmp/registry目錄下,可以通過 -v 參數來將鏡像文件存放在本地的指定路徑上(例如,放在本地目錄/root/my_registry下)。

2 向私有倉庫push鏡像

?
1
docker push 104.131.173.242:5000/ubuntu_sshd_gcc_gerry:14.04

說明:根據第一步啟動的registry容器所在宿主主機的IP和Port,push某環境的本地容器。

?
1
2
3
4
5
6
7
8
9
10
11
12
13
root@gerryyang:~# docker push 104.131.173.242:5000/ubuntu_sshd_gcc_gerry:14.04
The push refers to a repository [104.131.173.242:5000/ubuntu_sshd_gcc_gerry] (len: 1)
Sending image list
Pushing repository 104.131.173.242:5000/ubuntu_sshd_gcc_gerry (1 tags)
511136ea3c5a: Image successfully pushed
3b363fd9d7da: Image successfully pushed
607c5d1cca71: Image successfully pushed
f62feddc05dc: Image successfully pushed
8eaa4ff06b53: Image successfully pushed
894c0161121f: Image successfully pushed
a45787b0222f: Image successfully pushed
f0e3262ed661: Image successfully pushed
Pushing tag for rev [f0e3262ed661] on {http://104.131.173.242:5000/v1/repositories/ubuntu_sshd_gcc_gerry/tags/14.04}

宿主主機my_registry的目錄結構

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
root@gerryyang:~/my_registry# tree
.
├── images
│  ├── 3b363fd9d7dab4db9591058a3f43e806f6fa6f7e2744b63b2df4b84eadb0685a
│  │  ├── ancestry
│  │  ├── _checksum
│  │  ├── json
│  │  └── layer
│  ├── 511136ea3c5a64f264b78b5433614aec563103b4d4702f3ba7d4d2698e22c158
│  │  ├── ancestry
│  │  ├── _checksum
│  │  ├── json
│  │  └── layer
│  ├── 607c5d1cca71dd3b6c04327c3903363079b72ab3e5e4289d74fb00a9ac7ec2aa
│  │  ├── ancestry
│  │  ├── _checksum
│  │  ├── json
│  │  └── layer
│  ├── 894c0161121f105ac9b81bca7ac583ac1f29772625911db0fa2b6b475f5642fd
│  │  ├── ancestry
│  │  ├── _checksum
│  │  ├── json
│  │  └── layer
│  ├── 8eaa4ff06b53ff7730c4d7a7e21b4426a4b46dee064ca2d5d90d757dc7ea040a
│  │  ├── ancestry
│  │  ├── _checksum
│  │  ├── json
│  │  └── layer
│  ├── a45787b0222f955d68d9db34fb18033144b8a78015d9e306a1613894da0fd86e
│  │  ├── ancestry
│  │  ├── _checksum
│  │  ├── json
│  │  └── layer
│  ├── f0e3262ed6617896b306852c923e4c0e1d359b58b29a02ef849c4b8978c73c65
│  │  ├── ancestry
│  │  ├── _checksum
│  │  ├── json
│  │  └── layer
│  └── f62feddc05dc67da9b725361f97d7ae72a32e355ce1585f9a60d090289120f73
│    ├── ancestry
│    ├── _checksum
│    ├── json
│    └── layer
└── repositories
  └── library
    └── ubuntu_sshd_gcc_gerry
      ├── _index_images
      ├── tag_14.04
      └── tag14.04_json
 
12 directories, 35 files

關于https的問題

?
1
2
root@gerryyang:~# docker push 104.131.173.242:5000/ubuntu_sshd_gcc_gerry:14.04
FATA[0002] Error: Invalid registry endpoint https://104.131.173.242:5000/v1/: Get https://104.131.173.242:5000/v1/_ping: EOF. If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry 104.131.173.242:5000` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/104.131.173.242:5000/ca.crt

解決方法:

修改Docker配置文件

?
1
vim /etc/default/docker

增加以下一行

?
1
DOCKER_OPTS="$DOCKER_OPTS --insecure-registry=104.131.173.242:5000"

重啟Docker

?
1
sudo service docker restart

3 私有倉庫查詢方法

?
1
curl http://104.131.173.242:5000/v1/search

說明:使用curl查看倉庫104.131.173.242:5000中的鏡像。在結果中可以查看到ubuntu_sshd_gcc_gerry,說明已經上傳成功了。

?
1
2
3
4
gerryyang@mba:personal_repository$curl http://104.131.173.242:5000/v1/search
{"num_results": 0, "query": "", "results": []}
gerryyang@mba:personal_repository$curl http://104.131.173.242:5000/v1/search
{"num_results": 1, "query": "", "results": [{"description": "", "name": "library/ubuntu_sshd_gcc_gerry"}]}

4 在其他的機器上訪問和下載私有倉庫的鏡像

?
1
docker pull 104.131.173.242:5000/ubuntu_sshd_gcc_gerry:14.04
?
1
2
3
4
5
6
7
8
9
10
11
root@gerryyang:~# docker pull 104.131.173.242:5000/ubuntu_sshd_gcc_gerry:14.04
Pulling repository 104.131.173.242:5000/ubuntu_sshd_gcc_gerry
f0e3262ed661: Download complete 
511136ea3c5a: Download complete 
3b363fd9d7da: Download complete 
607c5d1cca71: Download complete 
f62feddc05dc: Download complete 
8eaa4ff06b53: Download complete 
894c0161121f: Download complete 
a45787b0222f: Download complete 
Status: Image is up to date for 104.131.173.242:5000/ubuntu_sshd_gcc_gerry:14.04

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持服務器之家。

原文鏈接:http://blog.csdn.net/delphiwcdj/article/details/43099877

延伸 · 閱讀

精彩推薦
Weibo Article 1 Weibo Article 2 Weibo Article 3 Weibo Article 4 Weibo Article 5 Weibo Article 6 Weibo Article 7 Weibo Article 8 Weibo Article 9 Weibo Article 10 Weibo Article 11 Weibo Article 12 Weibo Article 13 Weibo Article 14 Weibo Article 15 Weibo Article 16 Weibo Article 17 Weibo Article 18 Weibo Article 19 Weibo Article 20 Weibo Article 21 Weibo Article 22 Weibo Article 23 Weibo Article 24 Weibo Article 25 Weibo Article 26 Weibo Article 27 Weibo Article 28 Weibo Article 29 Weibo Article 30 Weibo Article 31 Weibo Article 32 Weibo Article 33 Weibo Article 34 Weibo Article 35 Weibo Article 36 Weibo Article 37 Weibo Article 38 Weibo Article 39 Weibo Article 40
主站蜘蛛池模板: 91精品综合久久久久久五月天 | 亚洲网站视频 | 操操操干干干 | 99视频免费| 亚洲精品一 | 国产成人精品免费 | 精品成人一区二区 | 欧美日韩一区二区在线观看 | 国产高清一区二区 | 免费看黄色一级电影 | 国产在线观看一区 | 精品欧美一区二区三区久久久 | 精品一区久久 | 羞羞网站免费观看 | 国产精品69毛片高清亚洲 | 伊人激情综合网 | 一区二区av | 国产精品色一区二区三区 | 91欧美激情一区二区三区成人 | 日韩成人在线看 | 日韩成人免费电影 | 日韩成人在线播放 | 午夜视频在线观看网站 | 一区二区在线视频 | 国产一区二区精品丝袜 | 精品国产凹凸成av人导航 | 久久伊人久久 | www.久草 | 国产福利一区二区 | 久久久久久久久久亚洲 | 亚洲欧美一区二区三区情侣bbw | 99亚洲伊人久久精品影院红桃 | 91在线视频播放 | 午夜免费福利影院 | 日本不卡免费一区二区三区综合久久 | 日韩欧美专区 | 成人免费看 | 91高清视频在线观看 | 精品国产一级 | 黄在线| a视频在线观看免费 |