VB.net 2010 视频教程 VB.net 2010 视频教程 python基础视频教程
SQL Server 2008 视频教程 c#入门经典教程 Visual Basic从门到精通视频教程
当前位置:
首页 > 网络工程 > linux编程 >
  • 容器技术之Docker私有镜像仓库docker-distribution

 

 在前边的博客中我们说到docker的架构由docker客户端、服务端以及仓库组成;docker仓库就是用来存放镜像的地方;其实docker registry我们理解为存放docker镜像仓库的仓库比较准确吧;因为docker的镜像仓库通常是把同一类的镜像用不同的版本来区别,而registry则是用来存放这些仓库的仓库;默认安装docker都是从dockerhub镜像仓库下载镜像;其实在生产环境中,我们很少去公有仓库上下载镜像,原因之一是公有仓库中的镜像在生产环境中使用,有些不适配,通常我们是去公有仓库下载基础镜像,然后基于基础镜像构建适合自己生产环境中的镜像;其次公有仓库镜像有很多都不是安全的镜像,这么说吧,我们不确定自己下载的镜像是否有后门,是否有挖矿代码,所以基于种种因素,我们还是有必要搭建自己私有的镜像仓库;今天我们就来聊一聊docker的私有镜像仓库的搭建;

  1、查看docker-distribution包简介

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[root@docker_registry ~]# yum info docker-distribution
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Available Packages
Name        : docker-distribution
Arch        : x86_64
Version     : 2.6.2
Release     : 2.git48294d9.el7
Size        : 3.5 M
Repo        : extras/7/x86_64
Summary     : Docker toolset to pack, ship, store, and deliver content
URL         : https://github.com/docker/distribution
License     : ASL 2.0
Description : Docker toolset to pack, ship, store, and deliver content
 
[root@docker_registry ~]#

  提示:docker-distribution这个包就是提供简单仓库服务软件实现;

  2、安装docker-distribution

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
[root@docker_registry ~]# yum install -y docker-distribution
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help).
The program yum-complete-transaction is found in the yum-utils package.
--> Running transaction check
---> Package docker-distribution.x86_64 0:2.6.2-2.git48294d9.el7 will be installed
--> Finished Dependency Resolution
 
Dependencies Resolved
 
===================================================================================================================
 Package                         Arch               Version                               Repository          Size
===================================================================================================================
Installing:
 docker-distribution             x86_64             2.6.2-2.git48294d9.el7                extras             3.5 M
 
Transaction Summary
===================================================================================================================
Install  1 Package
 
Total download size: 3.5 M
Installed size: 12 M
Downloading packages:
docker-distribution-2.6.2-2.git48294d9.el7.x86_64.rpm                                       | 3.5 MB  00:00:03    
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : docker-distribution-2.6.2-2.git48294d9.el7.x86_64                                               1/1
  Verifying  : docker-distribution-2.6.2-2.git48294d9.el7.x86_64                                               1/1
 
Installed:
  docker-distribution.x86_64 0:2.6.2-2.git48294d9.el7                                                             
 
Complete!
[root@docker_registry ~]#
相关教程