Harbor

Harbor

Habor是由VMWare中国团队开源的容器镜像仓库.

harbor用于存储和分发docker镜像的registry服务器.

https://github.com/goharbor/harbor

安装参考harbor文档.

管理harbor:

$ cd /data/harbor
docker-compose stop 停止
docker-compose start 恢复
docker-compose down -v  停止并删除container
docker-cmopose up -d 启动

docker使用harbor

Deploy a plain HTTP registry:

# vim /etc/docker/daemon.json
{
  "insecure-registries" : ["myregistrydomain.com:5000"]
}

Use self-signed certificates:

# cp your-ca /etc/docker/certs.d/harbor.domain.com/ca.crt
# vim     /lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd --insecure-registry harbor.domain.com
# systemctl daemon-reload
# systemctl restart docker

update hosts on docker client:

 # vim /etc/hosts
 <harbor-ip> harbor.domain.com

create user account:

https://<harbor-ip>

push:

$ docker login harbor.domain.com
docker tag SOURCE_IMAGE[:TAG] harbor.domain.com/<project>/IMAGE[:TAG]
docker push harbor.domain.com/<project>/IMAGE[:TAG]

pull:

$ docker login harbor.domain.com
docker pull harbor.domain.com/<project>/IMAGE[:TAG]

k8s使用harbor

https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/

您的支持是我创作的动力!