docker安装
代码语言:javascript复制yum -y install yum-utils
yum-config-manager --add-repo https://mirrors.ustc.edu.cn/docker-ce/linux/centos/docker-ce.repo
yum -y install docker-ce
[root@master ~]# systemctl start docker
[root@master ~]# docker --version
Docker version 20.10.1, build 831ebea
docker-compose安装
代码语言:javascript复制cd /usr/bin
导入docker-compose
加权限
chmod x docker-compose
docker-compose --version
harbor-http方式安装
下载harbor安装包https://github.com/goharbor/harbor/releases/
代码语言:javascript复制[root@localhost ~]# tar -zxf harbor-offline-installer-v2.2.2-rc1.tgz
[root@localhost ~]# cd harbor
[root@localhost harbor]# ls
common.sh harbor.v2.2.2.tar.gz harbor.yml.tmpl install.sh LICENSE prepare
重命名:
[root@localhost harbor]# mv harbor.yml.tmpl harbor.yml
修改配置文件:
[root@localhost harbor]# vim harbor.yml
开始安装harbor
代码语言:javascript复制[root@localhost harbor]# ./install.sh
...
[Step 5]: starting Harbor ...
Creating network "harbor_harbor" with the default driver
Creating harbor-log ... done
Creating harbor-db ... done
Creating harbor-portal ... done
Creating registryctl ... done
Creating registry ... done
Creating redis ... done
Creating harbor-core ... done
Creating harbor-jobservice ... done
Creating nginx ... done
✔ ----Harbor has been installed and started successfully.----
安装成功查看状态
[root@localhost harbor]# docker ps
关于harbor的停止与启动
代码语言:javascript复制[root@localhost ~]# cd harbor
[root@localhost harbor]# docker-compose down #停止
[root@localhost harbor]# docker-compose up -d #启动
访问harbor首页 http://192.168.1.80/