{"id":157,"date":"2022-11-17T14:17:36","date_gmt":"2022-11-17T06:17:36","guid":{"rendered":"http:\/\/www.bigqq.com\/?p=157"},"modified":"2022-11-17T14:17:36","modified_gmt":"2022-11-17T06:17:36","slug":"docker%e5%8f%91%e5%8c%85","status":"publish","type":"post","link":"http:\/\/www.bigqq.com\/?p=157","title":{"rendered":"docker\u53d1\u5305"},"content":{"rendered":"\n<p> Docker \u4e2d\u6709\u4e09\u4e2a\u6838\u5fc3\u6982\u5ff5\uff1aImage\u3001Container\u3001Repository\u3002 <\/p>\n\n\n\n<p><strong>\u672c\u673a\u5b89\u88c5docker\uff0c\u914d\u7f6e Docker Engine:<\/strong><\/p>\n\n\n\n<p>{<br>   &#8220;builder&#8221;: {<br>     &#8220;gc&#8221;: {<br>       &#8220;defaultKeepStorage&#8221;: &#8220;20GB&#8221;,<br>       &#8220;enabled&#8221;: true<br>     }<br>   },<br>   &#8220;debug&#8221;: false,<br>   &#8220;experimental&#8221;: false,<br>   &#8220;features&#8221;: {<br>     &#8220;buildkit&#8221;: true<br>   },<br>   &#8220;insecure-registries&#8221;: [<br>     &#8220;192.168.xxx.xxx:5555&#8221;<br>   ],<br>   &#8220;registry-mirrors&#8221;: []<br> }<\/p>\n\n\n\n<p><strong>\u670d\u52a1\u5668\u5b89\u88c5Harbor<\/strong><\/p>\n\n\n\n<p>\u521b\u5efa\u8d26\u6237<\/p>\n\n\n\n<p>\u672c\u673adocker login<\/p>\n\n\n\n<p><strong>\u670d\u52a1\u5668\u5b89\u88c5Rancher<\/strong><\/p>\n\n\n\n<p>\u901a\u8fc7Rancher\u7ba1\u7406\u5bb9\u5668\uff0c\u914d\u7f6e\u5bb9\u5668\u7aef\u53e3\u6620\u5c04\u3001\u73af\u5883\u53d8\u91cf\u7b49<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h_94844844_4\">Harbor<\/h2>\n\n\n\n<p>\u5b83\u7684\u76ee\u6807\u662f\u5e2e\u52a9\u7528\u6237\u8fc5\u901f\u642d\u5efa\u4e00\u4e2a\u4f01\u4e1a\u7ea7\u7684 Docker registry \u670d\u52a1\u3002\u5b83\u4ee5 Docker \u516c\u53f8\u5f00\u6e90\u7684 registry \u4e3a\u57fa\u7840\uff0c\u63d0\u4f9b\u4e86\u7ba1\u7406UI\uff0c\u57fa\u4e8e\u89d2\u8272\u7684\u8bbf\u95ee\u63a7\u5236(Role Based Access Control)\uff0cAD\/LDAP\u96c6\u6210\u3001\u4ee5\u53ca\u5ba1\u8ba1\u65e5\u5fd7(Auditlogging) \u7b49\u4f01\u4e1a\u7528\u6237\u9700\u6c42\u7684\u529f\u80fd\uff0c\u540c\u65f6\u8fd8\u539f\u751f\u652f\u6301\u4e2d\u6587\u3002Harbor \u7684\u6bcf\u4e2a\u7ec4\u4ef6\u90fd\u662f\u4ee5 Docker \u5bb9\u5668\u7684\u5f62\u5f0f\u6784\u5efa\u7684\uff0c\u4f7f\u7528 Docker Compose \u6765\u5bf9\u5b83\u8fdb\u884c\u90e8\u7f72\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h_94844844_5\">Rancher<\/h2>\n\n\n\n<p>rancher \u5bb9\u5668\u7ba1\u7406\u5e73\u53f0 \u5728\u751f\u4ea7\u73af\u5883\u4e2d\u8f7b\u677e\u5feb\u6377\u7684\u90e8\u7f72\u548c\u7ba1\u7406\u5bb9\u5668 \u7ba1\u7406K8s \u5185\u7f6eCI\/CD \u5feb\u901f\u642d\u5efa \u5bfc\u5165\u548c\u7eb3\u7ba1 \u96c6\u4e2d\u5f0f\u8eab\u4efd\u3002<\/p>\n\n\n\n<p>\u51c6\u786e\u7684\u8bf4\uff0cRancher\u662f\u4e00\u5957\u5bb9\u5668\u7ba1\u7406\u6253\u5305\u65b9\u6848\uff0c\u652f\u6301\u4e09\u79cd\u7f16\u6392\u5f15\u64ce\uff1aKubernetes\uff0cSwarm\uff0c\u8fd8\u6709Rancher\u81ea\u5df1\u5f00\u53d1\u7684Cattle\uff08\u6700\u8fd1\u597d\u50cf\u6362\u6210\u4e86Mesos\uff09\u3002\u4ece\u529f\u80fd\u7684\u5b8c\u6574\u6027\u548c\u6613\u7528\u6027\u6765\u770b\uff0cRancher\u751a\u81f3\u53ef\u4ee5\u7b97\u5f97\u4e0a\u4e00\u4e2a\u5546\u4e1a\u8f6f\u4ef6\u4e86\uff0c\u90e8\u7f72\u6781\u5176\u7b80\u5355\uff0c\u8fd9\u4e5f\u662f\u6211\u4eec\u9009\u62e9\u5b83\u4f5c\u4e3a\u5165\u95e8\u7ea7\u5bb9\u5668\u7ba1\u7406\u5e73\u53f0\u7684\u539f\u56e0<\/p>\n\n\n\n<p><strong>dockfile<\/strong><\/p>\n\n\n\n<p>FROM registry.cn-hangzhou.aliyuncs.com\/newbe36524\/aspnet:5.0-buster-slim AS base<br> WORKDIR \/app<\/p>\n\n\n\n<p>FROM registry.cn-hangzhou.aliyuncs.com\/newbe36524\/sdk:5.0-buster-slim AS build<br>\nWORKDIR \/src<br>\nCOPY . .<br>\nWORKDIR &#8220;\/src\/.&#8221;<\/p>\n\n\n\n<p>RUN sed -i &#8216;s\/TLSv1.2\/TLSv1\/g&#8217; \/etc\/ssl\/openssl.cnf<\/p>\n\n\n\n<p>RUN sed -i &#8216;s\/SECLEVEL=2\/SECLEVEL=1\/g&#8217; \/etc\/ssl\/openssl.cnf<\/p>\n\n\n\n<p>ENTRYPOINT [&#8220;dotnet&#8221;, &#8220;xx.dll&#8221;]<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>\u547d\u4ee4<\/strong><\/p>\n\n\n\n<p>docker build -t 192.168.xxx.xxx:5555\/xxx\/xx.web:v0.6.4.z .<br>docker push 192.168.xxx.xxx:5555\/xxx\/xx.web:v0.6.4.z<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Docker \u4e2d\u6709\u4e09\u4e2a\u6838\u5fc3\u6982\u5ff5\uff1aImag [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/www.bigqq.com\/index.php?rest_route=\/wp\/v2\/posts\/157"}],"collection":[{"href":"http:\/\/www.bigqq.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.bigqq.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.bigqq.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.bigqq.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=157"}],"version-history":[{"count":1,"href":"http:\/\/www.bigqq.com\/index.php?rest_route=\/wp\/v2\/posts\/157\/revisions"}],"predecessor-version":[{"id":158,"href":"http:\/\/www.bigqq.com\/index.php?rest_route=\/wp\/v2\/posts\/157\/revisions\/158"}],"wp:attachment":[{"href":"http:\/\/www.bigqq.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.bigqq.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=157"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.bigqq.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}