1. docker安装
(1)docker安装
#docker安装
cd /usr/
mkdir dcoker
cd docker
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum install -y docker-ce-20.10.12 docker-ce-cli-20.10.12 containerd.io-1.4.12
systemctl enable docker --now
docker version
ls
cd ~
#docker加速器安装,不安装pull不了镜像
# docker加速配置
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://82m9ar63.mirror.aliyuncs.com"],
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2"
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
(2)docker-compose安装
获取地址:
https://github.com/docker/compose/releases/tag/v2.2.1
# 设置文件权限
chmod a+x docker-compose-linux-x86_64
# 移动到/usr/bin目录下,并重命名为docker-compose
mv docker-compose-linux-x86_64 /usr/bin/docker-compose
#查看版本能查到即安装成功
docker-compose --version
若下载不下来则使用百度网盘地址:
链接:https://pan.baidu.com/s/1poVAPQ-DRcJSf02rEHkQ5g
提取码:8888
若也下载不下来则请用以下命令下载
#1.29.2版本
#1.29.2版本
curl -L https://github.com/docker/compose/releases/download/1.29.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version
(3)关闭防火墙
#关闭防火墙
systemctl stop firewalld.service
#查看防火墙状态
systemctl status firewalld.service
#禁止防火墙开机自动启动
systemctl disable firewalld.service
#注意关闭防火墙后docker需要重启
systemctl restart docker
2.harbr安装
(1)安装文件获取地址:
链接:https://pan.baidu.com/s/1LdwG65_LlNZGrr50ITTBXg
提取码:6ce7
(2)将获取到的文件上传到目标服务器
[root@node2 ~]# ls
anaconda-ks.cfg apache-maven-3.8.1-bin.tar.gz harbor-offline-installer-v2.3.4.tgz jdk-8u211-linux-x64.tar.gz
[root@node2 ~]# tar -zxvf harbor-offline-installer-v2.3.4.tgz
harbor/harbor.v2.3.4.tar.gz
harbor/prepare
harbor/LICENSE
harbor/install.sh
harbor/common.sh
harbor/harbor.yml.tmpl
[root@node2 ~]# mkdir /usr/local/docker/
[root@node2 ~]# ls
anaconda-ks.cfg apache-maven-3.8.1-bin.tar.gz harbor harbor-offline-installer-v2.3.4.tgz jdk-8u211-linux-x64.tar.gz
[root@node2 ~]# mv harbor /usr/local/docker/
[root@node2 ~]# ls
anaconda-ks.cfg apache-maven-3.8.1-bin.tar.gz harbor-offline-installer-v2.3.4.tgz jdk-8u211-linux-x64.tar.gz
[root@node2 ~]#
(3)进入harbor目录修改harbor.yml.tmpl 文件
cd /usr/local/docker/harbor
cp harbor.yml.tmpl harbor.yml
vim harbor.yml
修改位置如下图:
(4)修改完文件内容后执行安装
./install.sh
(5)查看容器启动 情况
docker ps
(6)登录
192.168.10.112:80
账号:admin
密码:Harbor12345
至此,harbor安装完成