rancher+harbor离线安装
安装docker,此docker为社区版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/安装环境:安装17.09版docker-ce,系统必须为centos7及以上,内核为3.10。否则会出现很多依赖问题。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先在自己的虚拟机里面将你需要的镜像拉下来。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 进一步压缩。上传到内网服务器上,然后解压到rancher_server.tar这一层,使用docker load < rancher_server.tar导入镜像。然后在使用docker run --restart=always -v /home/data/:/var/lib/mysql --name rancherS -p 8087:8080 -d rancher/server:stable用浏览器访问http://server_ip:8087进行访问 添加host,将标号5这个东西拿到主机中执行。生成rancher-agent的run脚本。将rancher-agent镜像及其附带镜像按照rancher-server的操作进行。导入之后运行之前生成的脚本安装harbor:需要Python下载所需要的软件包:harbor软件包下载地址:https://github.com/vmware/harbor/releasesdocker-compose下载地址:https://github.com/docker/compose/releases环境准备:docker version要在1.10以上 docker-compose要在1.6.0以上。docker-compose离线安装:下载docker-compose-Linux-x86_64然后重新命名添加可执行权限即可: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用虚拟机将镜像save到本地,传到服务器上面。(参考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 密钥认证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
配置完后执行./prepare进行更新操作。
容器run文件在docker-compose.yml里面。
common/templates/registry/config.yml这个是registry的配置文件。
进去harbor目录,执行./install.sh
验证,在浏览器中直接访问http://server_ip出现界面仓库。
停止使用docker-compose down