首頁 > 軟體

CentOS 7 Docker 搭建私有倉庫 registry

2020-06-16 17:51:17

環境規劃:

  • docker私有倉庫地址:192.168.0.167
  • docker用戶端地址 : 192.168.0.167

·關閉防火牆和selinux

 systemctl stop firewalld.service
  systemctl disable firewalld.service
 
  # vi /etc/sysconfig/selinux
        SELINUX=disabled
  # setenforce 0

伺服器端

1.安裝並啟動docker

yum -y install  docker
  service docker  start
  chkconfig docker  on

2.拉取本地私有倉庫registry

 [root@localhost ~]# docker pull registry
Trying to pull repository docker.io/registry ...
24dd746e9b9f: Download complete
706766fe1019: Download complete
a62a42e77c9c: Download complete
2c014f14d3d9: Download complete
b7cf8f0d9e82: Download complete
d0b170ebeeab: Download complete
171efc310edf: Download complete
522ed614b07a: Download complete
605ed9113b86: Download complete
22b93b23ebb9: Download complete
2ac557a88fda: Download complete
1f3b4c532640: Download complete
27ebaac643a7: Download complete
ce630195cb45: Download complete
Status: Downloaded newer image for docker.io/registry:latest

3.檢視registry映象

[root@localhost ~]# docker images
docker.io/busybox            latest              0064fda8c45d        5 days ago          1.113 MB
docker.io/registry          latest              105c6c9299d9        5 days ago          423.3 MB
docker.io/CentOS            latest              ce20c473cd8a        6 days ago          172.3 MB

4.基於私有倉庫映象執行容器


IT145.com E-mail:sddin#qq.com