centos安装docekr镜像仓库habor

预装环境:
1.docker
2.python-pip
3.git

yum install python-pip -y

yum install git -y

curl -O http://tar.matosiki.site/tar/harbor-offline-installer-v1.5.4.tgz

tar -xvzf harbor-offline-installer-v1.5.4.tgz -C /opt/

cd /opt/harbor/

vi /opt/harbor/harbor.cfg
#设置域名
hostname = 172.25.210.149
#设置访问协议
ui_url_protocol = http
./prepare

# 如果启动(harbor-log:v1.5.4 not found ) 手动将v1.5.4版本改成 v1.5.2
vi docker-compose.yml
# 注意修改nginx端口

docker-compose up -d

docker ps

# 默认使用admin/Harbor12345可以登录
curl http:172.25.210.149

启动六个容器

harbor-log

harbor-ui

registry

harbor-db

harbor-jobservice

nginx

docker配置私有仓库访问

vi /usr/lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd --insecure-registry 192.168.10.135
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s

[Install]
WantedBy=multi-user.target
本文总阅读量