安裝docker笙隙,此docker為社區(qū)版docker。docker官方文檔:https://docs.docker.comdocker-ce的yum源: https://download.docker.com/linux/centos/docker-ce.repo //使用yum安裝需要用到。docker rpm包下載地址 https://download.docker.com/linux/centos/7/x86_64/stable/Packages/安裝環(huán)境:安裝17.09版docker-ce,系統(tǒng)必須為centos7及以上,內(nèi)核為3.10判没。否則會出現(xiàn)很多依賴問題。container-selinux >= 2.9rpm -ivh container-selinux-2.9-4.el7.noarch.rpm安裝好container-selinux 在接著安裝dockerrpm -ivh docker-ce-17.09.0.ce-1.el7.centos.x86_64.rpmsystemctl start docker安裝rancher先在自己的虛擬機(jī)里面將你需要的鏡像拉下來隅茎。docker search 一下你需要的版本澄峰。然后使用docker pull 鏡像名及版本我這邊使用的是rancher/server:stable 這個版本是1.6.10的使用docker save rancher/server > rancher_server.tar 保存到本地。在使用gzip rancher_server.tar rancher_server.tar.gz 進(jìn)一步壓縮辟犀。上傳到內(nèi)網(wǎng)服務(wù)器上俏竞,然后解壓到rancher_server.tar這一層,使用docker load < rancher_server.tar導(dǎo)入鏡像踪蹬。然后在使用docker run --restart=always -v /home/data/:/var/lib/mysql --name rancherS -p 8087:8080 -d rancher/server:stable用瀏覽器訪問http://server_ip:8087進(jìn)行訪問 添加host胞此,將標(biāo)號5這個東西拿到主機(jī)中執(zhí)行。生成rancher-agent的run腳本跃捣。將rancher-agent鏡像及其附帶鏡像按照rancher-server的操作進(jìn)行。導(dǎo)入之后運(yùn)行之前生成的腳本安裝harbor:需要Python下載所需要的軟件包:harbor軟件包下載地址:https://github.com/vmware/harbor/releasesdocker-compose下載地址:https://github.com/docker/compose/releases環(huán)境準(zhǔn)備:docker version要在1.10以上 docker-compose要在1.6.0以上夺蛇。docker-compose離線安裝:下載docker-compose-Linux-x86_64然后重新命名添加可執(zhí)行權(quán)限即可:mv docker-compose-Linux-x86_64 /usr/local/bin/docker-compose;chmod +x /usr/local/bin/docker-composedocker harbor需要的images:vmware/harbor-uivmware/harbor-jobservicevmware/harbor-adminservervmware/harbor-dbvmware/registryvmware/harbor-notary-dbvmware/nginxvmware/notary-photon:signer-0.5.0vmware/notary-photon:server-0.5.0vmware/harbor-log用虛擬機(jī)將鏡像save到本地疚漆,傳到服務(wù)器上面。(參考rancher鏡像做法)解壓harbor壓縮包 tar zxf harbor-offline-installer-v1.1.2.tgzcd harborvim harbor.cfghostname = 10.46.235.121ui_url_protocol = httpdb_password = harbor2017max_job_workers = 3 customize_crt = on 密鑰認(rèn)證ssl_cert = /home/data/cert/server.crt#配置的路徑ssl_cert_key = /home/data/cert/server.key#配置的路徑secretkey_path = /home/dataadmiral_url = NAemail_identity = email_server = smtp.mydomain.comemail_server_port = 25email_username = sample_admin@mydomain.comemail_password = abcemail_from = adminemail_ssl = false
harbor_admin_password = harbor2017
auth_mode = db_auth
ldap_url = ldaps://ldap.mydomain.com
ldap_basedn = ou=people,dc=mydomain,dc=com
ldap_uid = uid
ldap_scope = 3
ldap_timeout = 5
self_registration = on
token_expiration = 30
project_creation_restriction = everyone
verify_remote_cert = on
配置完后執(zhí)行./prepare進(jìn)行更新操作刁赦。
容器run文件在docker-compose.yml里面娶聘。
common/templates/registry/config.yml這個是registry的配置文件。
進(jìn)去harbor目錄甚脉,執(zhí)行./install.sh
驗(yàn)證丸升,在瀏覽器中直接訪問http://server_ip出現(xiàn)界面?zhèn)}庫。
停止使用docker-compose down