搭建harbor容器鏡像平臺

一.環境說明

操作系統:centos7
docker:19.03.6
docker-compose:1.18.0

主機名 IP地址 類型
root@harbor 192.168.1.108 harbor
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
[root@localhost ~]# sed -i 's/enforcing/disabled/' /etc/selinux/config 
[root@localhost ~]# setenforce 0
[root@localhost ~]# hostnamecrt set-hostname harbor
[root@harbor ~]# echo "192.168.1.108 harbor" > /etc/hosts
[root@harbor ~]# yum -y install epel-release
[root@harbor ~]# wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo
[root@harbor ~]# yum -y install docker-ce
[root@harbor ~]# cat > /etc/docker/daemon.json <<EOF
{
  "exec-opts": ["native.cgroupdriver=systemd"],
  "insecure-registries":[ "192.168.1.108" ],
  "storage-driver": "overlay2"
}
EOF
[root@harbor ~]# curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f1361db2.m.daocloud.io

[root@harbor ~]# systemctl enable docker
[root@harbor ~]# systemctl start docker
[root@harbor ~]# yum -y install docker-compose
[root@harbor ~]# wget https://github.com/goharbor/harbor/releases/download/v1.10.1/harbor-offline-installer-v1.10.1.tgz
[root@harbor ~]# mkdir -p /data && tar -zxvfgharbor-offline-installer-v1.10.1.tgz -C /data/
[root@harbor ~]# cd /data/harbor && sed -i "s#hostname:.*#hostname: harbor#g" harbor.yml
[root@harbor ~]# sed -i "s#harbor_admin_password:.*#harbor_admin_password: 123456#g" harbor.yml
[root@harbor harbor]# ./install.sh
[root@harbor harbor]# docker login -uadmin -p123456 192.168.1.193


在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章