1、安装docker软件
[root@amumu ~]# tee /etc/yum.repos.d/docker.repo <<-'EOF'
[docker-main-repo]
name=Docker main Repository
baseurl=http://mirrors.aliyun.com/docker-engine/yum/repo/main/centos/7
enabled=1
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/docker-engine/yum/gpg
EOF
安装Docker软件
说明:在所有IP节点上执行
[root@amumu ~]# yum install -y docker-engine
1.1 私有仓库服务端配置部分:
配置docker配置文件
修改配置文件/etc/sysconfig/docker
OPTIONS='--selinux-enabled --log-driver=journald -g=/yschome/data/docker --registry-mirror=https://kyyfenk.mirror.acs.aliyun.com'
DOCKER_CERT_PATH=/etc/docker
ADD_REGISTRY='--add-registry 10.20.140.215:80'
DOCKER_OPTS="--insecure-registry 10.20.140.215:80"
INSECURE_REGISTRY='--insecure-registry 10.20.140.215:80'
启动docker服务
systemctl start docker
1.2安装harbor 部分
参考资料
http://blog.csdn.net/mideagroup/article/details/52053402
安装setuptools软件包:
下载:
[root@amumu ~]# wget https://pypi.python.org/packages/32/3c/e853a68b703f347f5ed86585c2dd2828a83252e1216c1201fa6f81270578/setuptools-26.1.1.tar.gz#md5=0744ee90ad266fb117d59f94334185d0
解压:
[root@amumu ~]# tar -zxvf setuptools-26.1.1.tar.gz
[root@amumu ~]# cd setuptools-26.1.1
编译:
[root@amumu setuptools-26.1.1]# python setup.py build
running build
running build_py
安装:
[root@amumu setuptools-26.1.1]# python setup.py install
安装pip组件
wget https://pypi.python.org/packages/e7/a8/7556133689add8d1a54c0b14aeff0acb03c64707ce100ecd53934da1aa13/pip-8.1.2.tar.gz#md5=87083c0b9867963b29f7aba3613e8f4a
tar zxvf pip-8.1.2.tar.gz
cd pip-8.1.2
python setup.py install
安装docker-compose
pip install U backports.ssl-match-hostname
pip install docker-compose
git clone https://github.com/vmware/harbor
https://github.com/vmware/harbor/releases
cd harbor/Deploy/
配置文件配置部分:
/usr/lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd -g=/yschome/data/docker --registry-mirror=https://kyyfenk.mirror.acs.aliyun.com
cd harbor/Deploy
#修改 harbor.cfg 中的hostname 192.168.1.10
egrep -v '^#|^$' harbor.cfg
$ vim harbor.cfg
hostname = 10.250.160.250
ui_url_protocol = http
email_server = smtp.mydomain.com
email_server_port = 25
email_username = [email protected]
email_password = abc
email_from = admin
email_ssl = false
harbor_admin_password = Harbor12345
auth_mode = db_auth
ldap_url = ldaps://ldap.mydomain.com
ldap_basedn = uid=%s,ou=people,dc=mydomain,dc=com
db_password = root123
self_registration = on
use_compressed_js = on
max_job_workers = 3
token_expiration = 30
verify_remote_cert = on
customize_crt = on
crt_country = CN
crt_state = State
crt_location = CN
crt_organization = organization
crt_organizationalunit = organizational unit
crt_commonname = example.com
crt_email = [email protected]
./prepare
docker-compose up -d
重新部署harbor:
./prepare
docker-compose stop
docker-compose rm -f
docker-compose up -d
客户端配置docker
vim /usr/lib/systemd/system/docker.service
ExecStart=/usr/bin/dockerd -g=/yschome/data/docker --insecure-registry 10.250.160.250 --registry-mirror=https://kyyfenk.mirror.acs.aliyun.com --cluster-advertise eth0:2375 --cluster-store consul://10.250.160.250:8500;
访问