设为首页 加入收藏

TOP

harbor仓库部署(五)
2023-07-23 13:29:41 】 浏览:79
Tags:harbor
d 1.0s ? Container registry Started 0.9s ? Container registryctl Started 1.2s ? Container harbor-portal Started 1.0s ? Container harbor-core Started 0.6s ? Container nginx Started 1.1s ? Container harbor-jobservice Started 0.9s [root@harbor ~]# vim harbor.sh //设置脚本使其开机自启 [root@harbor ~]# cat harbor.sh #!/bin/bash /usr/local/harbor && docker-compose start [root@harbor ~]# chmod +x harbor.sh //给脚本赋予执行权限 [root@harbor ~]# ll total 8 -rw-------. 1 root root 1081 Jul 19 16:17 anaconda-ks.cfg -rwxr-xr-x 1 root root 55 Aug 12 12:15 harbor.sh [root@harbor ~]# reboot //重启虚拟机 [root@harbor ~]# docker ps //查看状态 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 27d358705acf goharbor/harbor-jobservice:v2.5.3 "/harbor/entrypoint.…" 14 hours ago Up 11 seconds (health: starting) harbor-jobservice 917a7155677e goharbor/nginx-photon:v2.5.3 "nginx -g 'daemon of…" 14 hours ago Up 11 seconds (health: starting) 0.0.0.0:80->8080/tcp, :::80->8080/tcp nginx 6230fed03071 goharbor/harbor-core:v2.5.3 "/harbor/entrypoint.…" 14 hours ago Up 11 seconds (health: starting) harbor-core 290772e4a195 goharbor/harbor-registryctl:v2.5.3 "/home/harbor/start.…" 14 hours ago Up 11 seconds (health: starting) registryctl a78c22de9b73 goharbor/redis-photon:v2.5.3 "redis-server /etc/r…" 14 hours ago Up 11 seconds (health: starting) redis ef4560266151 goharbor/registry-photon:v2.5.3 "/home/harbor/entryp…" 14 hours ago Up 11 seconds (health: starting) registry 282d2180241e goharbor/harbor-db:v2.5.3 "/docker-entrypoint.…" 14 hours ago Up 12 seconds (health: starting) harbor-db 383c26c94150 goharbor/harbor-portal:v2.5.3 "nginx -g 'daemon of…" 14 hours ago Up 11 seconds (health: starting) harbor-portal 7fcbe6d544c9 goharbor/harbor-log:v2.5.3 "/bin/sh -c /usr/loc…" 14 hours ago Up 12 seconds (health: starting) 127.0.0.1:1514->10514/tcp harbor-log //成功实现开机自启

给自己搭建的私有仓库上传镜像

[root@harbor ~]# hostname
harbor.example.com
//在镜像仓库端查看主机名
[root@client ~]# vim /etc/hosts   
//在客户端这边添加一个镜像仓库端的映射
192.168.222.251 harbor.example.com
[root@client ~]# ping harbor.example.com
PING harbor.example.com (192.168.222.251) 56(84) bytes of data.
64 bytes from harbor.example.com (192.168.222.251): icmp_seq=1 ttl=64 time=0.994 ms
64 bytes from harbor.example.com (192.168.222.251): icmp_seq=2 ttl=64 time=3.12 ms
64 bytes from harbor.example.com (192.168.222.251): icmp_seq=3 ttl=64 time=1.75 ms
^C
--- harbor.example.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 0.994/1.955/3.119/0.879 ms
//实现客户端与镜像仓库端想通
[root@client ~]# vim /etc/docker/daemon.json 
 "insecure-registries":["harbor.example.com"]
//因为没有证书所以我们在客户端无法直接登录要在客户端进行设置一下
[root@client ~]# systemctl restart docker //重启docker
[root@client ~]# docker pull  lvnanhai66/httpd:2.0
2.0: Pulling from lvnanhai66/httpd
a1d0c7532777: Pull complete 
3189de0706ae: Pull complete 
4db75e208cea: Pull complete 
Digest: sha256:f8e25d4e1d8688526dfdff8919da43c667f708159ebcd3e7d6b5c9993f280ef6
Status: Downloaded newer image for lvnanhai66/httpd:2.0
docker.io/lvnanhai66/httpd:2.0
[root@client ~]# docker images
REPOSITORY         TAG       IMAGE ID       CREATED      SIZE
lvnanhai66/httpd   2.0       523de2557ebe   2
首页 上一页 2 3 4 5 下一页 尾页 5/5/5
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Linux Shell 自动交互功能 下一篇docker容器网络

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目