harbor仓库的安装和使用

2019-10-17  本文已影响0人  cowkeys

下载

wget https://storage.googleapis.com/harbor-releases/release-1.9.0/harbor-online-installer-v1.9.0.tgz

解压

tar zxvf harbor-online-installer-v1.9.0.tgz -C /usr/local/harbor/

修改harbor.yml 配置 密码和hostname 等等

hostname: 64.64.224.xxx
harbor_admin_password: admin111

安装

./install.sh
docker-compose start
➜  docker-compose -f /usr/local/harbor/docker-compose.yml ps
      Name                     Command                  State                 Ports          
---------------------------------------------------------------------------------------------
harbor-core         /harbor/harbor_core              Up (healthy)                            
harbor-db           /docker-entrypoint.sh            Up (healthy)   5432/tcp                 
harbor-jobservice   /harbor/harbor_jobservice  ...   Up (healthy)                            
harbor-log          /bin/sh -c /usr/local/bin/ ...   Up (healthy)   127.0.0.1:1514->10514/tcp
harbor-portal       nginx -g daemon off;             Up (healthy)   8080/tcp                 
nginx               nginx -g daemon off;             Up (healthy)   0.0.0.0:80->8080/tcp     
redis               redis-server /etc/redis.conf     Up (healthy)   6379/tcp                 
registry            /entrypoint.sh /etc/regist ...   Up (healthy)   5000/tcp                 
registryctl         /harbor/start.sh                 Up (healthy) 

界面


image.png

输入用户名密码进入


image.png

测试编译docker 推上harbor仓库

docker login 64.64.224.xxx
docker build -t 64.64.224.xxx/library/mdn-love-day:2.0 .
docker push 64.64.224.xxx/library/mdn-love-day:2.0
image.png

错误情况

1

WARNING: no logs are available with the 'syslog' log driver
docker info 查看logdrive是那一种,比如我的是json-file
则修改docker-compose.yml中的drive 到对应的drive: json-file

2

docker login docker.xx.com 登录不上
Error response from daemon: Get https://docker.yishi.tech/v2/: http: server gave HTTP response to HTTPS client
vim /etc/docker/daemon.json

加入

{
  "insecure-registries": ["docker.xx.com"]
}
systemctl restart docker
上一篇 下一篇

猜你喜欢

热点阅读