docker 部署harbor (并记录遇到的问题)

安装linux 
1.docker pull centos  (docker run -tdi --privileged centos init)
2.$ docker images
3.docker run -itd --name centos-test centos:latest
4.docker exec -it centos-test /bin/bash


Error: Failed to download metadata for repo ‘appstream‘: Cannot prepare internal mirrorlist

进入到 yum 的 repos 目录
cd /etc/yum.repos.d/
修改 centos 文件内容
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
2生成缓存更新(第一次更新,速度稍微有点慢,耐心等待两分钟左右)
yum makecache

运行 yum update 并重新安装 vim
yum update -y
yum -y install vim
————————————————


安装并启动docker

[root@localhost ~]# yum install -y yum-utils device-mapper-persistent-data lvm2
[root@localhost ~]# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo 
[root@localhost ~]# yum install -y docker-ce docker-ce-cli containerd.io
启动
[root@localhost ~]# systemctl start docker

部署harbo

#安装Docker-Compose
[root@localhost src]# yum install epel-release -y
[root@localhost src]# yum install python-pip3 -y
[root@localhost src]#  pip3 install --upgrade pip
[root@localhost src]# curl -L https://github.com/docker/compose/releases/download/1.18.0/run.sh > /usr/local/bin/docker-compose  (curl -L https://github.com/docker/compose/releases/download/1.24.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose)


  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   643  100   643    0     0   1267      0 --:--:-- --:--:-- --:--:--  1268
 
[root@localhost src]# chmod +x /usr/local/bin/docker-compose
[root@localhost src]# ls /usr/local/bin/docker-compose       
/usr/local/bin/docker-compose
 
#下载harbor 安装harbor
[root@localhost src]# cd /usr/src
 
[root@localhost src] wget -c https://storage.googleapis.com/harbor-releases/release-1.7.0/harbor-offline-installer-v1.7.0.tgz
 
[root@localhost src]# ls
debug  harbor  harbor-offline-installer-v1.7.0.tgz  kernels
 
[root@localhost src]# tar -zxvf harbor-offline-installer-v1.7.0.tgz
[root@localhost /]# cd /usr/src/harbor
[root@localhost harbor]# ./install.sh         (如果提示hostname修改 1.回到根目录 yum -y install vim   2.vim harbor.cfg  【修改hostname 127.0.0.1】3. 保存文件命令 按esc 然后:wq 即可)
                                                                      (如果提示first run docker   直接运行 yum install docker-compose -y)
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值