一、登录(无https证书模式)
http://192.168.199.205
默认的账号密码:
admin
Harbor12345
二、新增用户,可以赋权为管理员或者普通用户:
三、新建项目,可以定义为公开或者私有
点击项目名称:“1111”,可以设置项目
一般管理员对项目拥有所有操作权限
开发人员只能push/pull
四、测试(客户端)
先配置docker
vim /etc/docker/daemon.json
{
# 加入下面一行
"insecure-registries": ["192.168.199.201:443"]
}
重启docker
systemctl daemon-reload
systemctl restart docker
本地打包镜像
docker tag alpine:latest 192.168.199.205/1111/alpine:latest
# 注意:这里省略了端口443,如果是其他端口需要加上
# 例如:docker tag alpine:latest 192.168.199.205:9999/1111/alpine:latest
查看
# docker images | grep alpine
alpine latest c059bfaa849c 6 weeks ago 5.59MB
192.168.199.205/1111/alpine latest c059bfaa849c 6 weeks ago 5.59MB
本地登录仓库
# docker login http://192.168.199.205
Username: admin
Password: Harbor12345
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
本地打标签然后推送
# docker push 192.168.199.205/1111/alpine
Using default tag: latest
The push refers to repository [192.168.199.205/1111/alpine]
8d3ac3489996: Pushed
latest: digest: sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3 size: 528
下载pull
# docker pull 192.168.199.205/1111/alpine
Using default tag: latest
latest: Pulling from 1111/alpine
59bf1c3509f3: Pull complete
Digest: sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3
Status: Downloaded newer image for 192.168.199.205/1111/alpine:latest
192.168.199.205/1111/alpine:latest
五、可能需要备份到其他harbor上。
PS:这个因为我本地虚拟机不能启动两个harbor,所以用的同一个IP
新建一个备份策略