{"id":193753,"date":"2020-06-19T09:28:38","date_gmt":"2020-06-19T01:28:38","guid":{"rendered":"https:\/\/gulass.cn\/?p=193753"},"modified":"2020-06-15T09:29:36","modified_gmt":"2020-06-15T01:29:36","slug":"harbor","status":"publish","type":"post","link":"https:\/\/gulass.cn\/harbor.html","title":{"rendered":"\u4f01\u4e1a\u7ea7\u5b89\u88c5\u4e0e\u914d\u7f6eHarbor\u955c\u50cf\u7ba1\u7406\u7cfb\u7edf"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nHarbor\u662f\u6784\u5efa\u4f01\u4e1a\u7ea7\u79c1\u6709docker\u955c\u50cf\u7684\u4ed3\u5e93\u7684\u5f00\u6e90\u89e3\u51b3\u65b9\u6848\uff0c\u5b83\u662fDocker Registry\u7684\u66f4\u9ad8\u7ea7\u5c01\u88c5\uff0c\u5b83\u9664\u4e86\u63d0\u4f9b\u53cb\u597d\u7684Web UI\u754c\u9762\uff0c\u89d2\u8272\u548c\u7528\u6237\u6743\u9650\u7ba1\u7406\uff0c\u7528\u6237\u64cd\u4f5c\u5ba1\u8ba1\u7b49\u529f\u80fd\u5916\uff0c\u5b83\u8fd8\u6574\u5408\u4e86K8s\u7684\u63d2\u4ef6(Add-ons)\u4ed3\u5e93\uff0c\u5373Helm\u901a\u8fc7chart\u65b9\u5f0f\u4e0b\u8f7d\uff0c\u7ba1\u7406\uff0c\u5b89\u88c5K8s\u63d2\u4ef6\uff0c\u800cchartmuseum\u53ef\u4ee5\u63d0\u4f9b\u5b58\u50a8chart\u6570\u636e\u7684\u4ed3\u5e93<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
Harbor\u7b80\u4ecb<\/strong><\/span><\/div>\n

\u5728\u8bf4harbor\u4e4b\u524d\uff0c\u6211\u4eec\u9996\u5148\u8bf4\u4e00\u8bf4\u76f4\u63a5\u4f7f\u7528docker registry\u7684\u4e00\u4e9b\u7f3a\u9677\uff1a<\/p>\n

\u7f3a\u5c11\u8ba4\u8bc1\u673a\u5236\uff0c\u4efb\u4f55\u4eba\u90fd\u53ef\u4ee5\u968f\u610f\u62c9\u53d6\u53ca\u4e0a\u4f20\u955c\u50cf\uff0c\u5b89\u5168\u6027\u7f3a\u5931<\/p>\n

\u7f3a\u4e4f\u955c\u50cf\u6e05\u7406\u673a\u5236\uff0c\u955c\u50cf\u53ef\u4ee5push\u5374\u4e0d\u80fd\u5220\u9664\uff0c\u65e5\u79ef\u6708\u7d2f\uff0c\u5360\u7528\u7a7a\u95f4\u4f1a\u8d8a\u6765\u8d8a\u5927<\/p>\n

\u7f3a\u4e4f\u76f8\u5e94\u7684\u6269\u5c55\u673a\u5236<\/p>\n

\u9274\u4e8e\u4ee5\u4e0a\u7f3a\u70b9\uff0c\u6211\u4eec\u901a\u5e38\u5728\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u4e0d\u4f1a\u76f4\u63a5\u4f7f\u7528docker registry\u6765\u5b9e\u73b0\u63d0\u4f9b\u955c\u50cf\u670d\u52a1\u3002\u800cHarbor\u6b63\u597d\u89e3\u51b3\u4e86\u4e0a\u8ff0\u6240\u6709\u7684\u95ee\u9898\u3002<\/p>\n

Harbor\u662f\u4e00\u4e2a\u7528\u4e8e\u5b58\u50a8\u548c\u5206\u53d1Docker\u955c\u50cf\u7684\u4f01\u4e1a\u7ea7Registry\u670d\u52a1\u5668\uff0c\u901a\u8fc7\u6dfb\u52a0\u4e00\u4e9b\u4f01\u4e1a\u5fc5\u9700\u7684\u529f\u80fd\u7279\u6027\uff0c\u4f8b\u5982\u5b89\u5168\u3001\u6807\u8bc6\u548c\u7ba1\u7406\u7b49\uff0c\u6269\u5c55\u4e86\u5f00\u6e90Docker Distribution\u3002\u4f5c\u4e3a\u4e00\u4e2a\u4f01\u4e1a\u7ea7\u79c1\u6709Registry\u670d\u52a1\u5668\uff0cHarbor\u63d0\u4f9b\u4e86\u66f4\u597d\u7684\u6027\u80fd\u548c\u5b89\u5168\u3002\u63d0\u5347\u7528\u6237\u4f7f\u7528Registry\u6784\u5efa\u548c\u8fd0\u884c\u73af\u5883\u4f20\u8f93\u955c\u50cf\u7684\u6548\u7387\u3002Harbor\u652f\u6301\u5b89\u88c5\u5728\u591a\u4e2aRegistry\u8282\u70b9\u7684\u955c\u50cf\u8d44\u6e90\u590d\u5236\uff0c\u955c\u50cf\u5168\u90e8\u4fdd\u5b58\u5728\u79c1\u6709Registry\u4e2d\uff0c\u786e\u4fdd\u6570\u636e\u548c\u77e5\u8bc6\u4ea7\u6743\u5728\u516c\u53f8\u5185\u90e8\u7f51\u7edc\u4e2d\u7ba1\u63a7\u3002\u53e6\u5916\uff0cHarbor\u4e5f\u63d0\u4f9b\u4e86\u9ad8\u7ea7\u7684\u5b89\u5168\u7279\u6027\uff0c\u8bf8\u5982\u7528\u6237\u7ba1\u7406\uff0c\u8bbf\u95ee\u63a7\u5236\u548c\u6d3b\u52a8\u5ba1\u8ba1\u7b49\u3002<\/p>\n

Harbor\u5b98\u65b9\u7f51\u7ad9\uff1ahttp:\/\/vmware.github.io\/harbor\/<\/a><\/p>\n

Harbor\u6e90\u7801\u5730\u5740\uff1ahttps:\/\/github.com\/vmware\/harbor<\/a><\/p>\n

harbor\u7684\u4e8c\u8fdb\u5236\u5305\u540c\u65f6\u63d0\u4f9bonline\u548coffline\u7248\u672c\uff0c\u6211\u4eec\u8fd9\u91cc\u76f4\u63a5\u4f7f\u7528online\u7248\u672c\u3002<\/p>\n

\u914d\u7f6e<\/strong><\/div>\n
\u67b6\u6784\u56fe<\/strong><\/span><\/div>\n

\"\"<\/p>\n

\u5982\u4e0a\u56fe\u6240\u793a\uff0charbor\u75316\u5927\u6a21\u5757\u7ea7\u6210\uff1a<\/p>\n

Proxy: Harbor\u7684registry\u3001UI\u3001token services\u7b49\u7ec4\u4ef6\uff0c\u90fd\u5904\u5728\u4e00\u4e2a\u53cd\u5411\u4ee3\u7406\u540e\u8fb9\u3002\u8be5\u4ee3\u7406\u5c06\u6765\u81ea\u6d4f\u89c8\u5668\u3001docker clients\u7684\u8bf7\u6c42\u8f6c\u53d1\u5230\u540e\u7aef\u670d\u52a1\u4e0a\u3002<\/p>\n

Registry: \u8d1f\u8d23\u5b58\u50a8Docker\u955c\u50cf\uff0c\u4ee5\u53ca\u5904\u7406Docker push\/pull\u8bf7\u6c42\u3002\u56e0\u4e3aHarbor\u5f3a\u5236\u8981\u6c42\u5bf9\u955c\u50cf\u7684\u8bbf\u95ee\u505a\u6743\u9650\u63a7\u5236\uff0c \u5728\u6bcf\u4e00\u6b21push\/pull\u8bf7\u6c42\u65f6\uff0cRegistry\u4f1a\u5f3a\u5236\u8981\u6c42\u5ba2\u6237\u7aef\u4ecetoken service\u90a3\u91cc\u83b7\u5f97\u4e00\u4e2a\u6709\u6548\u7684token\u3002<\/p>\n

Core services: Harbor\u7684\u6838\u5fc3\u529f\u80fd\uff0c\u4e3b\u8981\u5305\u62ec\u5982\u4e0b3\u4e2a\u670d\u52a1:<\/p>\n

UI: \u4f5c\u4e3aRegistry Webhook, \u4ee5\u56fe\u50cf\u7528\u6237\u754c\u9762\u7684\u65b9\u5f0f\u8f85\u52a9\u7528\u6237\u7ba1\u7406\u955c\u50cf\u3002<\/p>\n

1) WebHook\u662f\u5728registry\u4e2d\u914d\u7f6e\u7684\u4e00\u79cd\u673a\u5236\uff0c \u5f53registry\u4e2d\u955c\u50cf\u53d1\u751f\u6539\u53d8\u65f6\uff0c\u5c31\u53ef\u4ee5\u901a\u77e5\u5230Harbor\u7684webhook endpoint\u3002Harbor\u4f7f\u7528webhook\u6765\u66f4\u65b0\u65e5\u5fd7\u3001\u521d\u59cb\u5316\u540c\u6b65job\u7b49\u3002 <\/p>\n

2) Token service\u4f1a\u6839\u636e\u8be5\u7528\u6237\u5728\u4e00\u4e2a\u5de5\u7a0b\u4e2d\u7684\u89d2\u8272\uff0c\u4e3a\u6bcf\u4e00\u6b21\u7684push\/pull\u8bf7\u6c42\u5206\u914d\u5bf9\u5e94\u7684token\u3002\u5047\u5982\u76f8\u5e94\u7684\u8bf7\u6c42\u5e76\u6ca1\u6709\u5305\u542btoken\u7684\u8bdd\uff0cregistry\u4f1a\u5c06\u8be5\u8bf7\u6c42\u91cd\u5b9a\u5411\u5230token service\u3002<\/p>\n

3) Database \u7528\u4e8e\u5b58\u653e\u5de5\u7a0b\u5143\u6570\u636e\u3001\u7528\u6237\u6570\u636e\u3001\u89d2\u8272\u6570\u636e\u3001\u540c\u6b65\u7b56\u7565\u4ee5\u53ca\u955c\u50cf\u5143\u6570\u636e\u3002<\/p>\n

Job services: \u4e3b\u8981\u7528\u4e8e\u955c\u50cf\u590d\u5236\uff0c\u672c\u5730\u955c\u50cf\u53ef\u4ee5\u88ab\u540c\u6b65\u5230\u8fdc\u7a0bHarbor\u5b9e\u4f8b\u4e0a\u3002<\/p>\n

Log collector: \u8d1f\u8d23\u6536\u96c6\u5176\u4ed6\u6a21\u5757\u7684\u65e5\u5fd7\u5230\u4e00\u4e2a\u5730\u65b9<\/p>\n

\u7ec4\u4ef6\u8bf4\u660e<\/strong><\/span><\/div>\n

\u9700\u8981\u8bf4\u660e\u7684\u662f\uff0charbor\u7684\u6bcf\u4e2a\u7ec4\u4ef6\u90fd\u662f\u4ee5Docker\u5bb9\u5668\u7684\u5f62\u5f0f\u6784\u5efa\u7684\uff0c\u53ef\u4ee5\u4f7f\u7528Docker Compose\u6765\u8fdb\u884c\u90e8\u7f72\uff0c\u5f53\u7136\uff0c\u5982\u679c\u4f60\u7684\u73af\u5883\u4e2d\u4f7f\u7528\u4e86kubernetes\uff0charbor\u4e5f\u63d0\u4f9b\u4e86kubernetes\u7684\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n

harbor\u5171\u67098\u4e2a\u5bb9\u5668\u7ec4\u6210\uff1a<\/p>\n

ui\uff1aharbor\u7684\u6838\u5fc3\u670d\u52a1\u3002<\/p>\n

log\uff1a\u8fd0\u884c\u7740rsyslog\u7684\u5bb9\u5668\uff0c\u8fdb\u884c\u65e5\u5fd7\u6536\u96c6\u3002<\/p>\n

mysql\uff1a\u7531\u5b98\u65b9mysql\u955c\u50cf\u6784\u6210\u7684\u6570\u636e\u5e93\u5bb9\u5668<\/p>\n

nginx\uff1a\u4f7f\u7528Nginx\u505a\u53cd\u5411\u4ee3\u7406<\/p>\n

registry\uff1a\u5b98\u65b9\u7684Docker registry<\/p>\n

adminserver\uff1aharbor\u7684\u914d\u7f6e\u6570\u636e\u7ba1\u7406\u5668<\/p>\n

jobservice\uff1aHarbor\u7684\u4efb\u52a1\u7ba1\u7406\u670d\u52a1\u3002<\/p>\n

redis\uff1a\u7528\u4e8e\u5b58\u50a8session<\/p>\n

\u4e0b\u9762\u6211\u4eec\u6240\u6709\u7684\u914d\u7f6e\u90fd\u4ee5harbor 1.5.2\u7248\u672c\u4f5c\u914d\u7f6e\u8bf4\u660e\u3002<\/p>\n

harbor\u53ef\u4ee5\u652f\u6301http\u548chttps\uff0c\u5efa\u8bae\u4f7f\u7528https\uff0chttps\u8bc1\u4e66\u6700\u597d\u662f\u53d7\u4fe1\u4efb\u7684ca\u9881\u53d1\u7684\u8bc1\u4e66\uff0c\u8fd9\u6837\uff0c\u5728\u914d\u7f6edocker\u7684\u65f6\u5019\uff0c\u5c31\u4e0d\u9700\u8981\u6dfb\u52a0\"insecure-registries\"\u914d\u7f6e\u9879\u3002\u6211\u4eec\u8fd9\u91cc\u5c31\u76f4\u63a5\u4f7f\u7528\u81ea\u7b7e\u540d\u8bc1\u4e66\u3002<\/p>\n

\u751f\u6210\u8bc1\u4e66\uff1a<\/p>\n

\r\nopenssl genrsa -des3 -out server.key 1024\r\nopenssl rsa -in server.key -out server.key    #\u53bb\u9664server.key\u7684\u52a0\u5bc6\u53e3\u4ee4\r\nopenssl req -new -key server.key -out server.csr\r\nopenssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt\r\n<\/pre>\n

\u5c06\u8bc1\u4e66\u653e\u5165\/data\/certs\/\u76ee\u5f55\u4e0b\uff1a<\/p>\n

\r\ncp server.crt server.key \/data\/certs\r\n<\/pre>\n
harbor.cfg\u914d\u7f6e\u6587\u4ef6\u793a\u4f8b<\/strong><\/span><\/div>\n

harbor\u7684\u6838\u5fc3\u914d\u7f6e\u6587\u4ef6\u662fharbor.cfg\uff0c\u8def\u5f84\u5728\u6e90\u7801\u76ee\u5f55\u4e0b\u7684make\u76ee\u5f55\u4e0b\uff0c\u793a\u4f8b\u914d\u7f6e\u5982\u4e0b\uff1a<\/p>\n

\r\n_version = 1.5.0\r\n\r\n# harbor\u7684\u8bbf\u95ee\u5730\u5740\r\nhostname = hub.dz11.com\r\n\r\n# \u4f7f\u7528https\u534f\u8bae\r\nui_url_protocol = https\r\n\r\n# harbor\u7684\u6570\u636e\u5e93\u5bc6\u7801\r\ndb_password = xxxxx\r\n\r\nmax_job_workers = 50\r\ncustomize_crt = on\r\n\r\n# \u8bc1\u4e66\u76f8\u5173\u8def\u5f84\r\nssl_cert = \/data\/certs\/dz11.com.crt\r\nssl_cert_key = \/data\/certs\/dz11.com.key\r\nsecretkey_path = \/data\r\n\r\nadmiral_url = NA\r\n\r\n# \u5b9a\u4e49\u65e5\u5fd7\u6eda\u52a8\r\nlog_rotate_count = 50\r\nlog_rotate_size = 200M\r\n\r\nhttp_proxy =\r\nhttps_proxy =\r\nno_proxy = 127.0.0.1,localhost,ui\r\n\r\n# email\u76f8\u5173\u914d\u7f6e\r\nemail_identity = \r\nemail_server = smtp.163.com\r\nemail_server_port = 25\r\nemail_username = yan_ruo_gu@163.com\r\nemail_password = yan_ruo_gu0711\r\nemail_from = admin \r\nemail_ssl = false\r\n\r\n# \u767b\u5f55harbor\u7684\u7ba1\u7406\u5458\u5bc6\u7801\r\nharbor_admin_password = xxxxxx\r\n\r\n# harbor\u7684\u9a8c\u8bc1\u65b9\u5f0f\uff0c\u652f\u6301db_auth\u548cldap_auth\uff0c\u8fd9\u91cc\u4f7f\u7528\u7684\u662fldap_auth\uff0c\u5982\u679c\u4f7f\u7528db_auth\u7684\u8bdd\uff0c\u76f4\u63a5\u5c06auth_mode\u4fee\u6539\u4e3adb_auth\u5373\u53ef\uff0cldap\u7684\u914d\u7f6e\u4e0d\u518d\u9700\u8981\u3002\r\nauth_mode = ldap_auth\r\nldap_url = ldap:\/\/10.1.1.1:389\r\nldap_searchdn = CN=jenkins,OU=LDAP,OU=Dev-wh.xxx.com,DC=dev-wh,DC=xxx,DC=com\r\nldap_search_pwd = xxxx\r\nldap_basedn = OU=Dev-wh.xxx.com,DC=dev-wh,DC=xxx,DC=com\r\nldap_filter = (objectClass=person)\r\nldap_uid = 0\r\nldap_scope = 2 \r\nldap_timeout = 5\r\n\r\nself_registration = on\r\ntoken_expiration = 30\r\nproject_creation_restriction = everyone\r\nverify_remote_cert = on\r\n\r\n# \u6570\u636e\u5e93\u76f8\u5173\u914d\u7f6e\uff0c\u9ed8\u8ba4\u5982\u679c\u4e0d\u9700\u8981\u4f7f\u7528\u81ea\u5efa\u7684\u6570\u636e\u5e93\uff0c\u8fd9\u4e9b\u914d\u7f6e\u5c31\u90fd\u4e0d\u9700\u8981\r\ndb_host = mysql\r\ndb_password = root123\r\ndb_port = 3306\r\ndb_user = root\r\nredis_url = redis:6379\r\nclair_db_host = postgres\r\nclair_db_password = password\r\nclair_db_port = 5432\r\nclair_db_username = postgres\r\nclair_db = postgres\r\nuaa_endpoint = uaa.mydomain.org\r\nuaa_clientid = id\r\nuaa_clientsecret = secret\r\nuaa_verify_cert = true\r\nuaa_ca_cert = \/path\/to\/ca.pem\r\nregistry_storage_provider_name = filesystem\r\nregistry_storage_provider_config =\r\n<\/pre>\n
\u90e8\u7f72harbor<\/strong><\/span><\/div>\n

harbor\u652f\u6301docker-compose\u548ckubernetes\u7684\u90e8\u7f72\u65b9\u5f0f\uff0c\u9ed8\u8ba4\u91c7\u7528docker-compose\u4f5c\u5355\u673a\u90e8\u7f72\u3002<\/p>\n

\u5148\u6267\u884c.\/prepare\uff0c\u7136\u540e\u6267\u884c.\/install.sh\u8fdb\u884c\u542f\u52a8\u3002\u6267\u884c.\/install.sh\u7684\u65f6\u5019\uff0c\u5373\u8c03\u7528\u4e86docker-compose\u8fd0\u884c\u4e86\u5f53\u524d\u76ee\u5f55\u4e0b\u7684docker-compose.yml\u6587\u4ef6\u3002<\/p>\n

\u5728\u6267\u884c.prepare\u7684\u65f6\u5019\u629b\u51fa\u5982\u4e0b\u5f02\u5e38\uff1a<\/p>\n

\r\nroot@ubuntu:~\/harbor# .\/prepare \r\nGenerated and saved secret to file: \/data\/secretkey\r\nGenerated configuration file: .\/common\/config\/nginx\/nginx.conf\r\nGenerated configuration file: .\/common\/config\/adminserver\/env\r\nGenerated configuration file: .\/common\/config\/ui\/env\r\nGenerated configuration file: .\/common\/config\/registry\/config.yml\r\nGenerated configuration file: .\/common\/config\/db\/env\r\nGenerated configuration file: .\/common\/config\/jobservice\/env\r\nGenerated configuration file: .\/common\/config\/jobservice\/config.yml\r\nGenerated configuration file: .\/common\/config\/log\/logrotate.conf\r\nGenerated configuration file: .\/common\/config\/jobservice\/config.yml\r\nGenerated configuration file: .\/common\/config\/ui\/app.conf\r\nFail to generate key file: .\/common\/config\/ui\/private_key.pem, cert file: .\/common\/config\/registry\/root.crt\r\n<\/pre>\n

\u9700\u8981\u4fee\u6539prepare\u6587\u4ef6\uff0c\u5c06\u7b2c498\u884c\uff1a<\/p>\n

\r\nempty_subj = \"\/C=\/ST=\/L=\/O=\/CN=\/\"\r\n\u4fee\u6539\u5982\u4e0b\uff1a\r\nempty_subj = \"\/C=US\/ST=California\/L=Palo Alto\/O=VMware, Inc.\/OU=Harbor\/CN=notarysigner\"\r\n<\/pre>\n

\u5728\u5b9e\u9645\u542f\u52a8\u8fc7\u7a0b\u4e2d\uff0c\u51fa\u73b0\u8fc7registry\u542f\u52a8\u5931\u8d25\u7684\u60c5\u51b5\uff0c\/var\/log\/harbor\/registry.log\u8f93\u51fa\u5982\u4e0b\uff1a<\/p>\n

\r\nMay 30 21:06:00 172.18.0.1 registry[3218]: panic: unable to configure authorization (token): unable to open token auth root certificate bundle file \"\/etc\/registry\/root.crt\": open \/etc\/registry\/root.crt: permission denied\r\nMay 30 21:06:00 172.18.0.1 registry[3218]: \r\nMay 30 21:06:00 172.18.0.1 registry[3218]: goroutine 1 [running]:\r\nMay 30 21:06:00 172.18.0.1 registry[3218]: panic(0xb4cd40, 0xc4203ae160)\r\nMay 30 21:06:00 172.18.0.1 registry[3218]: #011\/usr\/local\/go\/src\/runtime\/panic.go:500 +0x1a1\r\nMay 30 21:06:00 172.18.0.1 registry[3218]: github.com\/docker\/distribution\/registry\/handlers.NewApp(0x1067820, 0xc4203a8630, 0xc4202df180, 0x1067820)\r\nMay 30 21:06:00 172.18.0.1 registry[3218]: #011\/go\/src\/github.com\/docker\/distribution\/registry\/handlers\/app.go:302 +0x1b6a\r\nMay 30 21:06:00 172.18.0.1 registry[3218]: github.com\/docker\/distribution\/registry.NewRegistry(0x7fcfa30dd198, 0xc4203a8630, 0xc4202df180, 0xe, 0x0, 0x0)\r\nMay 30 21:06:00 172.18.0.1 registry[3218]: #011\/go\/src\/github.com\/docker\/distribution\/registry\/registry.go:86 +0x213\r\nMay 30 21:06:00 172.18.0.1 registry[3218]: github.com\/docker\/distribution\/registry.glob..func1(0x108f1a0, 0xc42036d240, 0x1, 0x1)\r\nMay 30 21:06:00 172.18.0.1 registry[3218]: #011\/go\/src\/github.com\/docker\/distribution\/registry\/registry.go:55 +0x106\r\nMay 30 21:06:00 172.18.0.1 registry[3218]: github.com\/docker\/distribution\/vendor\/github.com\/spf13\/cobra.(*Command).execute(0x108f1a0, 0xc42036d1f0, 0x1, 0x1, 0x108f1a0, 0xc42036d1f0)\r\nMay 30 21:06:00 172.18.0.1 registry[3218]: #011\/go\/src\/github.com\/docker\/distribution\/vendor\/github.com\/spf13\/cobra\/command.go:495 +0x190\r\nMay 30 21:06:00 172.18.0.1 registry[3218]: github.com\/docker\/distribution\/vendor\/github.com\/spf13\/cobra.(*Command).Execute(0x108f340, 0xc4201d7f40, 0xc4200001a0)\r\nMay 30 21:06:00 172.18.0.1 registry[3218]: #011\/go\/src\/github.com\/docker\/distribution\/vendor\/github.com\/spf13\/cobra\/command.go:560 +0x3c3\r\nMay 30 21:06:00 172.18.0.1 registry[3218]: main.main()\r\nMay 30 21:06:00 172.18.0.1 registry[3218]: #011\/go\/src\/github.com\/docker\/distribution\/cmd\/registry\/main.go:24 +0x2d\r\n<\/pre>\n

\u8fd9\u662f\u56e0\u4e3aregistry\u5bb9\u5668\u6ca1\u6709\/etc\/registry\/root.crt\u7684\u8bbf\u95ee\u6743\u9650\u5bfc\u81f4\u3002\u8fd9\u4e2a\u6587\u4ef6\u9ed8\u8ba4\u662f\u6302\u8f7d\u7684.\/common\/config\/registry\/root.crt\u8fd9\u4e2a\u6587\u4ef6\uff0c\u6240\u4ee5\u6211\u4eec\u9700\u8981\u5bf9\u8fd9\u4e2a\u6587\u4ef6\u4f5c\u6388\u6743\u3002<\/p>\n

\u901a\u8fc7\u89c2\u5bdf\u53ef\u77e5\uff0charbor\u7684\u5bb9\u5668\u542f\u52a8\u7528\u6237\u975eroot\u8eab\u4efd\uff0c\u800c\u662f\u4ee5\u4e00\u4e2auid\u548cgid\u90fd\u4e3a10000\u7684\u7528\u6237\u3002\u6240\u4ee5\u53ea\u9700\u8981\u4e3a\u8be5\u7528\u6237\u6388\u6743\u5373\u53ef\uff1a<\/p>\n

\r\nchown 10000.10000 .\/common\/config\/registry\/root.crt\r\n<\/pre>\n

\u6b63\u5e38\u542f\u52a8\u4e4b\u540e\uff0c\u914d\u7f6e\u5b8c\u6210\u3002<\/p>\n

\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u65b9\u5f0f\u8bbf\u95ee\uff1a https:\/\/hub.dz11.com<\/p>\n

\u6ce8\u610f\u4e8b\u9879<\/strong><\/span><\/div>\n

\u9700\u8981\u8bf4\u660e\u7684\u662f\uff0charbor\u652f\u6301http\u548chttps\uff0c\u4f46\u5982\u679c\u4f7f\u7528http\u7684\u8bdd\uff0c\u5728\u62c9\u53d6\u955c\u50cf\u7684\u65f6\u5019\uff0c\u4f1a\u629b\u51fa\u4ed3\u5e93\u4e0d\u53d7\u4fe1\u4efb\u7684\u5f02\u5e38\u3002\u9700\u8981\u5728\u6240\u6709\u7684docker\u5ba2\u6237\u7aef\u7684docker\u914d\u7f6e\u6587\u4ef6\/etc\/docker\/daemon.json\u4e2d\u6dfb\u52a0\u5982\u4e0b\u914d\u7f6e\uff1a<\/p>\n

\r\n{\r\n    \"insecure-registries\": [\"https:\/\/hub.dz11.com\"],\r\n}\r\n<\/pre>\n

\u5982\u679c\u4f7f\u7528\u81ea\u7b7e\u540d\u7684https\u8bc1\u4e66\uff0c\u4ecd\u7136\u4f1a\u63d0\u793a\u8bc1\u4e66\u4e0d\u53d7\u4fe1\u4efb\u7684\u95ee\u9898\u3002\u9700\u8981\u5c06\u81ea\u7b7e\u540d\u7684ca\u8bc1\u4e66\u53d1\u9001\u5230\u6240\u6709\u7684docker\u5ba2\u6237\u7aef\u7684\u6307\u5b9a\u76ee\u5f55\u3002<\/p>\n

\u5173\u4e8e\u4f7f\u7528\u81ea\u7b7e\u540d\u8bc1\u4e66\u914d\u7f6eharbor\u7684\u5177\u4f53\u8fc7\u7a0b\u53ef\u4ee5\u53c2\u8003\uff1ahttps:\/\/github.com\/WingkaiHo\/docker-calico\/blob\/master\/harbor\/README.md<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

\u5728\u8bf4harbor\u4e4b\u524d\uff0c\u6211\u4eec\u9996\u5148\u8bf4\u4e00\u8bf4\u76f4\u63a5\u4f7f\u7528docker registry\u7684\u4e00\u4e9b\u7f3a\u9677\uff1a \u7f3a\u5c11\u8ba4\u8bc1\u673a\u5236\uff0c\u4efb\u4f55\u4eba\u90fd […]<\/p>\n","protected":false},"author":668,"featured_media":142060,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-193753","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/193753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/668"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=193753"}],"version-history":[{"count":4,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/193753\/revisions"}],"predecessor-version":[{"id":193758,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/193753\/revisions\/193758"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/142060"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=193753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=193753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=193753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}