docker使用harbor搭建私有仓库

1.下载harbar-offline包

wget   https://storage.googleapis.com/harbor-releases/release-1.8.0/harbor-offline-installer-v1.8.0.tgz

tar  harbor-offline-installer-v1.8.0.tgz

2.修改harbor目录中harbor.yml文件

hostname:   本主机IP或者域名

3.安装docker-compose工具

yum install docker-compose  -y

4.安装harbor,运行harbor目录下install脚本 

./install.sh    #脚本运行完后  harbor安装正常 ,可以打开web页面

docker-compose编排docker容器时,默认使用当前目录下的*.yml文件,也可以使用docker-compose -f file 命令指定文件位置

######################################

自建harbor使用http协议进行镜像传输是,要修改/etc/docker/daemon.json,然后重启docker服务器

"insecure-registries": [ "IP:PORT" ]

image上传:

1.登录

docker log IP

2.本地镜像打好tag

docker tag nginx:stable-alpine 192.168.116.128/test/nginx:v-0.1

docker tag busybox 192.168.116.128/test/busybox:v-0.1

3.上传

docker push 192.168.116.128/test/nginx     后面无标签表示上传整个仓库中所有镜像

docker push 192.168.116.128/test/busybox   后面无标签表示上传整个仓库中所有镜像

###############################

CPU为可压缩资源  内存为不可压缩资源 

猜你喜欢

转载自www.cnblogs.com/chen-wg/p/10931007.html