centos7 harbor安装与配置
时间: 2023-10-10 16:10:50 浏览: 148
CentOS 7上的Harbor安装和配置包括以下步骤:
1. 安装Docker。
2. 启动Docker服务。
3. 将Docker添加为启动项。
4. 配置Docker镜像加速。
5. 下载Harbor安装包。
6. 解压缩并进行配置。
7. 启动Harbor服务。
请按照以下步骤进行操作:
1. 首先,安装Docker并启动Docker服务。
2. 然后,将Docker添加为启动项,以确保Docker服务在系统重启后自动启动。
3. 接下来,配置Docker的镜像加速,以提高镜像下载速度。
4. 下载Harbor安装包,并解压缩到指定目录。
5. 在解压缩后的Harbor目录中,修改配置文件harbor.yml,根据需要进行配置。
6. 修改主机名(hostname)并注释掉https部分。
7. 最后,运行prepare和install.sh命令以完成Harbor的安装和配置。
8. 访问http://xx.xx.xx.xx/,使用默认用户名admin和密码Harbor12345登录Harbor。
相关问题
centos7 harbor
您的问题是关于CentOS 7上安装Harbor的吗?如果是,以下是安装步骤:
1. 安装Docker和Docker Compose
```
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 install -y docker-ce docker-ce-cli containerd.io
systemctl start docker
systemctl enable docker
```
```
curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
```
2. 下载并安装Harbor
```
wget https://github.com/goharbor/harbor/releases/download/v2.3.0/harbor-offline-installer-v2.3.0.tgz
tar xvf harbor-offline-installer-v2.3.0.tgz
cd harbor
```
修改 `harbor.yml` 文件,将 `hostname` 和 `https` 的值设置为您的主机名和端口号。
3. 安装Harbor
```
./install.sh --with-notary --with-clair
```
4. 配置Docker客户端
将Harbor服务器的CA证书复制到Docker客户端的 `/etc/docker/certs.d/` 目录下,并重命名为Harbor服务器的主机名。
5. 使用Harbor
现在您可以使用Harbor存储和管理Docker镜像了。您可以使用 `docker login` 命令登录Harbor,并使用 `docker push` 和 `docker pull` 命令上传和下载镜像。
希望这些步骤对您有所帮助!
centos7安装harbor
在 CentOS 7 上安装 Harbor(华为云容器镜像服务),你需要先确保你的系统已经更新到最新版本,并且已经安装了必要的依赖,如 Docker 和 Git。以下是简化的安装步骤:
1. **安装依赖**:
- 更新包列表并安装 EPEL (Extra Packages for Enterprise Linux) 插件,它包含 Harbor 需要的一些工具:
```
sudo yum update -y epel-release
```
2. **安装 Docker**:
- 安装 Docker CE(Community Edition):
```
sudo yum install docker-ce docker-ce-cli containerd.io -y
systemctl start docker
systemctl enable docker
```
3. **安装 Harbor**:
- 创建一个新的用户harbor用于 Harbor 服务,并设置密码:
```
useradd -ms /bin/bash harbor
sudo passwd harbor
```
- 使用以下命令克隆Harbor的GitHub仓库,然后解压并进入目录:
```
git clone https://github.com/goharbor/harbor.git
cd harbor
```
- 设置环境变量,替换`<your-password>`为你为harbor用户设定的密码:
```
export GOPATH=$PWD
export PATH=$PATH:$GOPATH/bin
mkdir -p $HOME/.docker
echo '{"auths":{"/harbor/<your-domain>": {"username":"harbor","password":"<your-password>","email":""}}}' > $HOME/.docker/config.json
```
4. **构建和运行 Harbor**:
- 进入Harbor的目录并初始化项目:
```
./make/local.sh init
```
- 构建Harbor服务:
```
./make/local.sh build
```
- 启动 Harbor 服务(注意,这一步骤会创建一些配置文件,如果已存在则会覆盖它们):
```
./make/local.sh up
```
5. **检查是否成功**:
- 访问 `http://<your-server-ip>:8080`,你应该能看到 Harbor 的登录界面。
阅读全文
相关推荐












