/data/harbor启动Harbor,可以使用-d在后台运行。Harbor是包含一组容器,proxy容器是对外访问的nginx,端口配置为宿主机的8082端口了。
[root@izuf6buyhgwtrx60bq2okoz harbor]# docker-compose up
Starting harbor-log ... done
Starting redis ...
Starting registryctl ...
Starting registry ...
Starting harbor-db ...
Starting harbor-db ... done
Starting harbor-core ... done
Starting nginx ...
Starting nginx ... done
Attaching to harbor-log, redis, registry, harbor-db, harbor-portal, registryctl, harbor-core, harbor-jobservice, nginx
redis | WARNING: no logs are available with the 'syslog' log driver
registry | WARNING: no logs are available with the 'syslog' log driver
harbor-db | WARNING: no logs are available with the 'syslog' log driver
harbor-portal | WARNING: no logs are available with the 'syslog' log driver
registryctl | WARNING: no logs are available with the 'syslog' log driver
harbor-core | WARNING: no logs are available with the 'syslog' log driver
harbor-jobservice | WARNING: no logs are available with the 'syslog' log driver
nginx | WARNING: no logs are available with the 'syslog' log driver
访问 http://xxx.xxx.xxx.69:8082/ 使用admin用户登录,创建用户test,创建项目ccs,然后加入成员test。
使用test用户登录Harbor
[root@izuf6buyhgwtrx60bq2okoz harbor]# docker login -u test -p Harbor12345 http://xxx.xxx.xxx.69:8082
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
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
[root@izuf6buyhgwtrx60bq2okoz harbor]# docker tag televr:v1 http://47.101.57.69:8082/ccs/telvevr:v1
Error parsing reference: "http://xxx.xxx.xxx.xxx:8082/ccs/telvevr:v1" is not a valid repository/tag: invalid reference format
[root@izuf6buyhgwtrx60bq2okoz harbor]# docker tag televr:v1 xxx.xxx.xxx.xxx:8082/ccs/telvevr:v1
[root@izuf6buyhgwtrx60bq2okoz harbor]# docker push xxx.xxx.xxx.xxx:8082/ccs/telvevr:v1
The push refers to repository [xxx.xxx.xxx.xxx:8082/ccs/telvevr]
a219619a8c0a: Preparing
fac5e0a59e43: Preparing
35c20f26d188: Preparing
c3fe59dd9556: Preparing
6ed1a81ba5b6: Preparing
a3483ce177ce: Waiting
ce6c8756685b: Waiting
30339f20ced0: Waiting
0eb22bfb707d: Waiting
a2ae92ffcd29: Waiting
denied: requested access to the resource is denied
docker tag重命名需要上传的镜像注意没有http开头。由于之前用户test角色为访客,没有权限。修改为维护人员,重新执行上传成功。
上传后