1. 安装环境
1. 安装docker
$ yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine
$ yum install -y yum-utils device-mapper-persistent-data lvm2
$ yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
$ yum-config-manager --enable docker-ce-edge
$ yum install -y docker-ce-18.09.0-3.el7.x86_64
$ systemctl start docker
$ systemctl enable docker
2. 安装docker-componse
$ curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
$ chmod +x /usr/local/bin/docker-compose
$ ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
$ docker-compose --version
docker-compose version 1.24.1, build 1110ad01
3. 安装harbor
$ wget -c https://storage.googleapis.com/harbor-releases/release-1.8.0/harbor-offline-installer-v1.8.2-rc1.tgz
$ tar zxvf harbor-offline-installer-v1.8.2-rc1.tgz
$ cd harbor
配置harbor.yml
$ vim harbor.yml
根据自需修改内容
hostname: #IP地址或域名
http:
port: 8088 #启动页面的端口号,建议修改其他端口,默认端口是80
https:
port: 443
certificate: xxx
private_key: xxx
harbor_admin_password: 123456 #页面admin用户的登陆密码,默认的密码Harbor12345
database:
password: xxxx
data_volumn: /data
运行安装的harbor
$ ./install.sh
查看harbor容器,启动的服务
$ docker-compose ps
发现自动创建nginx和数据库db
停止harbor容器
$ docker-compose stop
后台启动harbor容器
docker-compose up -d
当启动容器,使用admin用户登录