docker私有仓库harbor安装与使用

前言:
harbor汉意为港湾,是存储Docker镜像的企业级Registry服务。参考文档https://github.com/goharbor/harbor/blob/master/docs/installation_guide.md


一、安装

1、查看docker是否已安装
    docker -v
    Docker version 18.09.6, build 481bc77
2、安装Docker Compose
	sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
	sudo chmod +x /usr/local/bin/docker-compose
	docker-compose -v
3、安装harbor
	https://github.com/goharbor/harbor/releases
	tar -zxvf harbor-offline-installer-v1.8.1.tgz
	cd harbor
	vim harbor.yml
	hostname: *.*.*.*6
	sudo ./install.sh
	安装完成会自动启动
4、验证
	访问http://*.*.*.*6
	默认用户名密码
	admin
	Harbor12345

二、使用

1、启动与停止
    sudo docker-compose start|stop|restart
2、修改docker配置
    sudo vim /etc/docker/daemon.json
    {"insecure-registries": ["*.*.*.*6"]}
    sudo systemctl daemon-reload
    sudo systemctl restart docker
3、镜像上传
    sudo docker tag hello-world:latest *.*.*.*6/test/hello-world:latest
    sudo docker login *.*.*.*6
    sudo docker push *.*.*.*6/test/hello-world:latest
4、镜像下载
    sudo docker rmi *.*.*.*6/test/hello-world
    sudo docker pull *.*.*.*6/test/hello-world

你可能感兴趣的:(docker)