最新版Harbor在ubuntu系统上安装最新版本的Harbor安装在ubuntu系统上安装dockerInstalldockerroot@hello:~#curl-fsSLhttps://get.docker.com|bash-sdocker--mirrorAliyunroot@hello:~#配置DockerComposeConfigureDockerComposeroot@hello:~#sudocurl-L"https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname-s)-$(uname-m)"-o/usr/local/bin/docker-compose%Total%Received%XferdAverageSpeedTimeTimeTimeCurrentDloadUploadTotalSpentLeft速度1006331006330024440--:--:----:--:----:--:--244410012.1M10012.1M0010.2M00:00:010:00:01--:--:--26.2Mroot@hello:~#sudochmod+x/usr/local/bin/docker-composeroot@hello:~#sudoln-s/usr/local/bin/docker-compose/usr/bin/docker-composeroot@hello:~#docker-compose--versiondocker-composeversion1.29.2,build5becea4croot@hello:~#下载DockerHarbor安装包下载DockerHarbor安装包root@hello:~#wgethttps://github.com/goharbor/harbor/releases/download/v2.3.2/harbor-offline-installer-v2.3.2.tgzroot@hello:~#解压安装包解压安装包root@hello:~#tarxvfharbor-offline-installer-v2.3.2.tgz-C/usr/local/harbor/harbor.v2.3.2.tar.gzharbor/prepareharbor/LICENSEharbor/install.shharbor/common.shharbor/harbor.yml.tmplroot@hello:~#cd/usr/local/harbor/配置证书ConfigureCertificateroot@hello:/usr/local/harbor#mkdircaroot@hello:/usr/local/harbor#cdca/root@hello:/usr/local/harbor/ca#pwd/usr/local/harbor/caroot@hello:/usr/local/harbor/ca#opensslgenrsa-des3-outserver.key2048生成RSA私钥,2048位长模数(2个素数)......................................+++++........................................................................................................................................................+++++eis65537(0x010001)Enterpassphraseforserver.key:Verifying-输入server.key:root@hello:/usr/local/harbor/ca#root@hello:/usr/local/harbor/ca#root@hello:/usr/local/harbor的密码/ca#opensslreq-new-keyserver.key-outserver.csrEnterpassphraseforserver.key:你将被要求输入将被合并到你的证书请求中的信息。你将要输入的是什么称为专有名称或DN。有很多字段,但您可以留空某些字段会有默认值,如果您输入“.”,该字段将留空。------国家名称(2个字母代码)[AU]:州或省名称(全名)[Some-State]:地方名称(例如,城市)[]:组织名称(例如,公司)[InternetWidgitsPtyLtd]:组织单位名称(例如,部分)[]:通用名称(例如服务器FQDN或您的名称)[]:电子邮件地址[]:请输入以下“额外”属性以与您的证书请求一起发送挑战密码[]:一个选项l公司名[]:root@hello:/usr/local/harbor/ca#root@hello:/usr/local/harbor/ca#cpserver.keyserver.key.orgroot@hello:/usr/local/harbor/ca#opensslrsa-inserver.key.org-outserver.keyEnterpassphraseforserver.key.org:writingRSAkeyroot@hello:/usr/local/harbor/ca#opensslx509-req-days365-in复制代码server.csr-signkeyserver.key-outserver.crtSignatureoksubject=C=AU,ST=Some-State,O=InternetWidgitsPtyLtdGettingPrivatekeyroot@hello:/usr/local/harbor/ca#修改配置文件,修改hostname和证书路径即可修改配置文件,修改hostname和认证路径root@hello:/usr/local/harbor#cpharbor.yml.tmplharbor.ymlroot@hello:/usr/local/harbor#root@hello:/usr/local/harbor#vimharbor.ymlroot@hello:/usr/local/harbor#catharbor.yml#Harborhostname的配置文件:harbor.chenby.cn#http相关配置http:#http的端口,默认为80。如果开启了https,这个端口会重定向到https端口port:80#httpsrelatedconfighttps:#harbor的https端口,默认为443port:443#nginxcertificate的cert和key文件的路径:/usr/local/harbor/ca/server.crtprivate_key:/usr/local/harbor/ca/server.keyharbor_admin_password:Harbor12345----略----root@hello:/usr/local/harbor#安装Installroot@hello:/usr/local/harbor#./install.sh[步骤0]:检查是否docker是安装...注意:docker版本:20.10.8[第1步]:检查是否安装了docker-compose...注意:docker-compose版本:1.29.2[第2步]:加载Harbor图像...加载图像:goharbor/redis-photon:v2.3.2加载图像:goharbor/nginx-photon:v2.3.2加载图像:goharbor/harbor-portal:v2.3.2加载图像:goharbor/trivy-adapter-photon:v2.3.2加载图像:goharbor/chartmuseum-photon:v2.3.2加载图像:goharbor/notary-signer-photon:v2.3.2加载图像:goharbor/harbor-core:v2.3.2加载图像:goharbor/harbor-log:v2.3.2加载图像:goharbor/harbor-registryctl:v2.3.2加载图像:goharbor/harbor-exporter:v2.3.2加载图像:goharbor/notary-server-photon:v2.3.2加载图像:goharbor/prepare:v2.3.2加载图像:goharbor/harbor-db:v2.3.2加载图像:goharbor/harbor-jobservice:v2.3.2加载图像:goharbor/registry-photon:v2.3.2[步骤3]:准备环境...[步骤4]:准备harbor配置...准备基础目录设置为/usr/local/harbor清除配置文件:/config/portal/nginx.conf清除配置文件:/config/log/rsyslog_docker.conf清除配置文件:/config/log/logrotate.conf生成的配置文件:/config/portal/nginx.conf生成的配置文件:/config/log/logrotate.confconf生成的配置文件:/config/log/rsyslog_docker.conf生成的配置文件:/config/nginx/nginx.conf生成的配置文件:/config/core/env生成的配置文件:/config/core/app.conf生成的配置文件:/config/registry/config.yml生成的配置文件:/config/registryctl/env生成的c配置文件:/config/registryctl/config.yml生成的配置文件:/config/db/env生成的配置文件:/config/jobservice/env生成的配置文件:/config/jobservice/config.yml生成并保存secret到文件:/data/secret/keys/secretkeySuccessfullycalledfunc:create_root_certGeneratedconfigurationfile:/compose_location/docker-compose.ymlCleanuptheinputdir【第五步】:启动Harbor...Creatingnetwork"harbor_harbor"withthedefaultdriverCreatingharbor-log...doneCreatingharbor-portal...doneCreatingharbor-db...doneCreatingregistryctl...doneCreatingredis...doneCreatingregistry...doneCreatingharbor-core...doneCreatingharbor-jobservice...doneCreatingnginx...完成了吗?----Harbor已经安装启动成功----root@hello:/usr/local/harbor#配置dns解析,或者在本地host中配置,具体配置策略配置dns解析,或者在本地配置主机,具体配置ration省略Login登录默认账号:admin默认密码:Harbor12345默认账号:admin默认密码:Harbor12345clientuseClientuseroot@hello:~#vim/etc/docker/daemon.jsonroot@hello:~#root@hello:~#cat/etc/docker/daemon.json{"insecure-registries":["https://harbor.chenby.cn"]}root@hello:~#root@hello:~#systemctldaemon-reloadroot@hello:~#root@hello:~#root@hello:~#sudosystemctlrestartdockerroot@hello:~#dockerloginhttps://harbor.chenby.cn/用户名:admin密码:警告!您的密码将以未加密的方式存储在/root/.docker/config.json中。配置一个凭据帮助程序以删除此警告。参见https://docs.docker.com/engine/reference/commandline/login/#credentials-storeLoginSucceededroot@hello:~#Linux运维交流社区Linux运维交流社区,互联网新闻和技术交流。38篇原创内容公众号本文使用文章同步助手同步
