打开路由转发
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
sysctl -p
下载最新 Docker-Compose:
curl -L https://github.com/docker/compose/releases/download/1.21.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
加速方法:
进入/etc/host,加上54.231.98.184 github-com.s3.amazonaws.com
换源加速:
curl -L https://get.daocloud.io/docker/compose/releases/download/1.21.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
下载 Harbor 安装程序:
wget https://github.com/goharbor/harbor/releases/download/v1.2.2/harbor-online-installer-v1.2.2.tgz
解压软件包:
tar -zxvf harbor-online-installer-v1.2.2.tgz -C /usr/local/
vim /usr/local/harbor/harbor.cfg
修改以下内容:
hostname = 192.168.1.11
阿里云加速docker拉取镜像(否则下载镜像时,会很慢会卡顿):
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://aq63ygn3.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
启动Harbor:
sh /usr/local/harbor/install.sh
查看 Harbor 启动镜像:
docker-compose ps
如果一切都正常,应该可以打开浏览器访问 http://192.168.1.11 的管理页面,默认 的管理员用户名和密码是 admin/Harbor12345
创建一个新项目
1、输入用户名和密码登录界面后可以创建一个新项目。点击“+项目”按钮