1、安装docker-18.06.3
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 --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum-config-manager --disable docker-ce-edge
sudo yum-config-manager --disable docker-ce-test
yum makecache fast
yum install docker-ce-18.06.3.ce -y
systemctl start docker
systemctl enable docker
2、安装pip
yum install python-pip
3、安装docker-compose
pip install docker-compose
docker-compose --version
4、下载harbor的安装包
wget https://storage.googleapis.com/harbor-releases/release-1.8.0/harbor-offline-installer-v1.8.2.tgz
tar -zxvf harbor-offline-installer-v1.8.2.tgz
vi harbor.yml
./install.sh
安装成功
使用的终端配置:
1、配置
vi /usr/lib/systemd/system/docker.service
里面的这行修改为:(其实就是添加 --insecure-registry 192.168.0.199 )
systemctl daemon-reload && service restart docker
2、登陆
admin登陆
docker login 192.168.0.199
本地镜像打标签
docker tag nginx:latest 192.168.0.199/library/nginx:test
推送到远程镜像私库
删除本地镜像
docker rmi 192.168.0.199/library/nginx:test
重新下载镜像
docker pull 192.168.0.199/library/nginx:test