网站建设资讯

NEWS

网站建设资讯

K8S集群安装之安装Docker容器的私有仓库-创新互联

一、在运维主机上安装私有仓库步骤

cd /opt
opt]# mkdir src
opt]# cd src/
# 可以去这个地址下载,也可以直接用我用的软件包
https://github.com/goharbor/harbor/releases/tag/v1.8.3
src]# tar xf harbor-offline-installer-v1.8.3.tgz -C /opt/
src]# cd /opt/
opt]# mv harbor/ harbor-v1.8.3
opt]# ln -s /opt/harbor-v1.8.3/ /opt/harbor
opt]# cd harbor
harbor]# ll
harbor]# vi harbor.yml        #修改harbor文件的内容
hostname: test-harbor.cedarhd.com
http:
  port: 180                                         #修改默认端口,后面会安装NGINX反代
data_volume: /data/harbor
location: /data/harbor/logs

harbor]# mkdir -p /data/harbor/logs
harbor]# yum install docker-compose -y     #harbor依赖的docer-compose组件运行
harbor]# rpm -qa docker-compose
# out: docker-compose-1.18.0-4.el7.noarch
harbor]# ./install.sh          #安装并运行harbor
harbor]# docker-compose ps       #安装当前运行的容器进程
harbor]# docker ps -a
[root@test-operator certs]# docker ps
CONTAINER ID        IMAGE                                               COMMAND                  CREATED             STATUS                  PORTS                       NAMES
a5b3eb804709        goharbor/nginx-photon:v1.8.3                        "nginx -g 'daemon of…"   2 days ago          Up 47 hours (healthy)   0.0.0.0:180->80/tcp         nginx
84b61a9d364b        goharbor/harbor-jobservice:v1.8.3                   "/harbor/start.sh"       2 days ago          Up 47 hours                                         harbor-jobservice
9d6db31fdaa6        goharbor/harbor-portal:v1.8.3                       "nginx -g 'daemon of…"   2 days ago          Up 47 hours (healthy)   80/tcp                      harbor-portal
1b6169cd0b99        goharbor/harbor-core:v1.8.3                         "/harbor/start.sh"       2 days ago          Up 47 hours (healthy)                               harbor-core
cd132bba509a        goharbor/harbor-db:v1.8.3                           "/entrypoint.sh post…"   2 days ago          Up 47 hours (healthy)   5432/tcp                    harbor-db
9708d7e2ed19        goharbor/redis-photon:v1.8.3                        "docker-entrypoint.s…"   2 days ago          Up 47 hours             6379/tcp                    redis
293e1726014a        goharbor/registry-photon:v2.7.1-patch-2819-v1.8.3   "/entrypoint.sh /etc…"   2 days ago          Up 47 hours (healthy)   5000/tcp                    registry
4bfc311f4858        goharbor/harbor-registryctl:v1.8.3                  "/harbor/start.sh"       2 days ago          Up 47 hours (healthy)                               registryctl
80a12b72f589        goharbor/harbor-log:v1.8.3                          "/bin/sh -c /usr/loc…"   2 days ago          Up 47 hours (healthy)   127.0.0.1:1514->10514/tcp   harbor-log

harbor]# yum install nginx -y    #安装NGINX反向代理到harbor180端口
harbor]# vi /etc/nginx/conf.d/harbor.od.com.conf
server {
    listen       80;
    server_name  harbor.od.com;

    client_max_body_size 1000m;

    location / {
        proxy_pass http://127.0.0.1:180;
    }
}
harbor]# nginx -t
harbor]# systemctl start nginx
harbor]# systemctl enable nginx

K8S集群安装 之 安装Docker容器的私有仓库

创新互联建站是创新、创意、研发型一体的综合型网站建设公司,自成立以来公司不断探索创新,始终坚持为客户提供满意周到的服务,在本地打下了良好的口碑,在过去的十年时间我们累计服务了上千家以及全国政企客户,如轻质隔墙板等企业单位,完善的项目管理流程,严格把控项目进度与质量监控加上过硬的技术实力获得客户的一致赞美。

二、推送一个镜像到harbor私有仓库

harbor]# docker pull nginx:1.7.9
harbor]# docker images|grep 1.7.9
harbor]# docker tag 84581e99d807 test-harbor.cedarhd.com/public/nginx:v1.7.9
harbor]# docker login test-harbor.cedarhd.com
账号:admin
密码:Harbor12345
200 harbor]# docker push test-harbor.cedarhd.com/public/nginx:v1.7.9

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


网页题目:K8S集群安装之安装Docker容器的私有仓库-创新互联
分享地址:http://cdweb.net/article/egphi.html