{"id":36862,"date":"2025-05-12T20:01:09","date_gmt":"2025-05-12T12:01:09","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/36862.html"},"modified":"2025-05-12T20:01:09","modified_gmt":"2025-05-12T12:01:09","slug":"%e6%9c%8d%e5%8a%a1%e5%99%a8-centos%e4%b8%8a%e5%ae%89%e8%a3%85docker%e5%b9%b6%e4%bd%bf%e7%94%a8docker%e9%85%8d%e7%bd%aejenkins","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/36862.html","title":{"rendered":"\u670d\u52a1\u5668---centos\u4e0a\u5b89\u88c5docker\u5e76\u4f7f\u7528docker\u914d\u7f6ejenkins"},"content":{"rendered":"<p>\u8981\u5728 Docker \u4e2d\u5b89\u88c5 Jenkins \u5e76\u8fdb\u884c\u7ba1\u7406&#xff0c;\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c&#xff1a;<\/p>\n<h4>1. \u5b89\u88c5 Docker<\/h4>\n<p>\u9996\u5148&#xff0c;\u786e\u4fdd\u4f60\u7684\u7cfb\u7edf\u5df2\u7ecf\u5b89\u88c5\u4e86 Docker\u3002\u5982\u679c\u5c1a\u672a\u5b89\u88c5&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5&#xff1a;<\/p>\n<h5>\u5728 CentOS \u4e0a\u5b89\u88c5 Docker<\/h5>\n<p><span class=\"token function\">sudo<\/span> yum <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-y<\/span> yum-utils<br \/>\n<span class=\"token function\">sudo<\/span> yum-config-manager &#8211;add-repo https:\/\/download.docker.com\/linux\/centos\/docker-ce.repo<br \/>\n<span class=\"token function\">sudo<\/span> yum <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-y<\/span> docker-ce docker-ce-cli containerd.io<\/p>\n<p>\u542f\u52a8 Docker \u5e76\u8bbe\u7f6e\u4e3a\u5f00\u673a\u542f\u52a8&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> systemctl start <span class=\"token function\">docker<\/span><br \/>\n<span class=\"token function\">sudo<\/span> systemctl <span class=\"token builtin class-name\">enable<\/span> <span class=\"token function\">docker<\/span><\/p>\n<p>\u9a8c\u8bc1 Docker \u662f\u5426\u6210\u529f\u5b89\u88c5&#xff1a;<\/p>\n<p><span class=\"token function\">docker<\/span> <span class=\"token parameter variable\">&#8211;version<\/span><\/p>\n<h4>2. \u62c9\u53d6 Jenkins \u955c\u50cf<\/h4>\n<p>\u4f7f\u7528 Docker \u62c9\u53d6 Jenkins \u7684\u5b98\u65b9\u955c\u50cf&#xff1a;<\/p>\n<p><span class=\"token function\">docker<\/span> pull jenkins\/jenkins:lts<\/p>\n<h4>3. \u8fd0\u884c Jenkins \u5bb9\u5668<\/h4>\n<p>\u8fd0\u884c Jenkins \u5bb9\u5668&#xff0c;\u5e76\u6620\u5c04\u7aef\u53e3\u548c\u6302\u8f7d\u5377&#xff1a;<\/p>\n<p><span class=\"token function\">docker<\/span> run <span class=\"token parameter variable\">-d<\/span> <span class=\"token parameter variable\">&#8211;name<\/span> jenkins <span class=\"token parameter variable\">-p<\/span> <span class=\"token number\">8080<\/span>:8080 <span class=\"token parameter variable\">-p<\/span> <span class=\"token number\">50000<\/span>:50000 <span class=\"token parameter variable\">-v<\/span> jenkins_home:\/var\/jenkins_home jenkins\/jenkins:lts<\/p>\n<ul>\n<li>-d&#xff1a;\u540e\u53f0\u8fd0\u884c\u5bb9\u5668\u3002<\/li>\n<li>&#8211;name jenkins&#xff1a;\u5bb9\u5668\u540d\u79f0\u4e3a jenkins\u3002<\/li>\n<li>-p 8080:8080&#xff1a;\u5c06\u5bb9\u5668\u7684 8080 \u7aef\u53e3\u6620\u5c04\u5230\u4e3b\u673a\u7684 8080 \u7aef\u53e3\u3002<\/li>\n<li>-p 50000:50000&#xff1a;\u5c06\u5bb9\u5668\u7684 50000 \u7aef\u53e3\u6620\u5c04\u5230\u4e3b\u673a\u7684 50000 \u7aef\u53e3\u3002<\/li>\n<li>-v jenkins_home:\/var\/jenkins_home&#xff1a;\u6302\u8f7d\u5377&#xff0c;\u7528\u4e8e\u6301\u4e45\u5316 Jenkins \u6570\u636e\u3002<\/li>\n<\/ul>\n<h4>4. \u67e5\u770b Jenkins \u5bb9\u5668\u72b6\u6001<\/h4>\n<p>\u67e5\u770b Jenkins \u5bb9\u5668\u662f\u5426\u6b63\u5728\u8fd0\u884c&#xff1a;<\/p>\n<p><span class=\"token function\">docker<\/span> <span class=\"token function\">ps<\/span><\/p>\n<h4>5. \u8bbf\u95ee Jenkins<\/h4>\n<p>\u5728\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee http:\/\/&lt;your-ip&gt;:8080&#xff0c;\u6309\u7167\u63d0\u793a\u5b8c\u6210 Jenkins \u7684\u521d\u59cb\u8bbe\u7f6e\u3002\u901a\u5e38&#xff0c;\u4f60\u9700\u8981\u8f93\u5165\u521d\u59cb\u7ba1\u7406\u5458\u5bc6\u7801&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u83b7\u53d6&#xff1a;<\/p>\n<p><span class=\"token function\">docker<\/span> <span class=\"token builtin class-name\">exec<\/span> jenkins <span class=\"token function\">cat<\/span> \/var\/jenkins_home\/secrets\/initialAdminPassword<\/p>\n<h4>6. \u7ba1\u7406 Jenkins \u5bb9\u5668<\/h4>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684 Docker \u547d\u4ee4&#xff0c;\u7528\u4e8e\u7ba1\u7406 Jenkins \u5bb9\u5668&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u542f\u52a8\u5bb9\u5668&#xff1a;<\/p>\n<p> <span class=\"token function\">docker<\/span> start jenkins\n <\/li>\n<li>\n<p>\u505c\u6b62\u5bb9\u5668&#xff1a;<\/p>\n<p> <span class=\"token function\">docker<\/span> stop jenkins\n <\/li>\n<li>\n<p>\u91cd\u542f\u5bb9\u5668&#xff1a;<\/p>\n<p> <span class=\"token function\">docker<\/span> restart jenkins\n <\/li>\n<li>\n<p>\u67e5\u770b\u5bb9\u5668\u65e5\u5fd7&#xff1a;<\/p>\n<p> <span class=\"token function\">docker<\/span> logs <span class=\"token parameter variable\">-f<\/span> jenkins\n <\/li>\n<li>\n<p>\u8fdb\u5165\u5bb9\u5668\u5185\u90e8&#xff1a;<\/p>\n<p> <span class=\"token function\">docker<\/span> <span class=\"token builtin class-name\">exec<\/span> <span class=\"token parameter variable\">-it<\/span> jenkins <span class=\"token function\">bash<\/span>\n <\/li>\n<\/ul>\n<h4>7. \u914d\u7f6e Jenkins<\/h4>\n<p>\u5b8c\u6210\u521d\u59cb\u8bbe\u7f6e\u540e&#xff0c;\u53ef\u4ee5\u901a\u8fc7 Jenkins \u7684 Web \u754c\u9762\u8fdb\u884c\u914d\u7f6e\u548c\u7ba1\u7406\u3002\u53ef\u4ee5\u5b89\u88c5\u5fc5\u8981\u7684\u63d2\u4ef6&#xff0c;\u914d\u7f6e\u7528\u6237\u6743\u9650&#xff0c;\u4ee5\u53ca\u521b\u5efa\u548c\u7ba1\u7406 Jenkins Job\u3002<\/p>\n<h4>8. \u4f7f\u7528 Docker Compose \u7ba1\u7406 Jenkins<\/h4>\n<p>\u4e3a\u4e86\u66f4\u65b9\u4fbf\u5730\u7ba1\u7406 Jenkins&#xff0c;\u53ef\u4ee5\u4f7f\u7528 Docker Compose\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b docker-compose.yml \u6587\u4ef6&#xff1a;<\/p>\n<p><span class=\"token key atrule\">version<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#039;3&#039;<\/span><br \/>\n<span class=\"token key atrule\">services<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">jenkins<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">image<\/span><span class=\"token punctuation\">:<\/span> jenkins\/jenkins<span class=\"token punctuation\">:<\/span>lts<br \/>\n    <span class=\"token key atrule\">container_name<\/span><span class=\"token punctuation\">:<\/span> jenkins<br \/>\n    <span class=\"token key atrule\">ports<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token string\">&#034;8080:8080&#034;<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token string\">&#034;50000:50000&#034;<\/span><br \/>\n    <span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> jenkins_home<span class=\"token punctuation\">:<\/span>\/var\/jenkins_home<br \/>\n<span class=\"token key atrule\">volumes<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">jenkins_home<\/span><span class=\"token punctuation\">:<\/span><\/p>\n<p>\u542f\u52a8 Jenkins \u5bb9\u5668&#xff1a;<\/p>\n<p><span class=\"token function\">docker-compose<\/span> up <span class=\"token parameter variable\">-d<\/span><\/p>\n<h4>\u77e5\u9053\u5982\u4f55\u5b89\u88c5&#xff0c;\u90a3\u5982\u4f55\u5378\u8f7d\u91cd\u88c5jenkins?<\/h4>\n<p>\u597d\u7684&#xff0c;\u7ee7\u7eed\u8fdb\u884c Jenkins \u7684\u91cd\u88c5\u548c\u7ba1\u7406\u64cd\u4f5c\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u7684\u6b65\u9aa4&#xff1a;<\/p>\n<h4>1. \u505c\u6b62\u5e76\u5220\u9664\u73b0\u6709 Jenkins \u5bb9\u5668<\/h4>\n<p>\u9996\u5148&#xff0c;\u786e\u4fdd Jenkins \u5bb9\u5668\u5df2\u7ecf\u505c\u6b62\u5e76\u5220\u9664&#xff1a;<\/p>\n<p><span class=\"token function\">docker<\/span> stop jenkins<br \/>\n<span class=\"token function\">docker<\/span> <span class=\"token function\">rm<\/span> jenkins<\/p>\n<h4>2. \u5220\u9664 Jenkins \u6570\u636e\u5377&#xff08;\u53ef\u9009&#xff09;<\/h4>\n<p>\u5982\u679c\u4f60\u5e0c\u671b\u5f7b\u5e95\u6e05\u9664 Jenkins \u7684\u6570\u636e&#xff0c;\u53ef\u4ee5\u5220\u9664 Jenkins \u7684\u6570\u636e\u5377&#xff1a;<\/p>\n<p><span class=\"token function\">docker<\/span> volume <span class=\"token function\">rm<\/span> jenkins_home<\/p>\n<h4>3. \u62c9\u53d6\u6700\u65b0\u7684 Jenkins \u955c\u50cf<\/h4>\n<p>\u786e\u4fdd\u4f60\u4f7f\u7528\u7684\u662f\u6700\u65b0\u7684 Jenkins \u955c\u50cf&#xff1a;<\/p>\n<p><span class=\"token function\">docker<\/span> pull jenkins\/jenkins:lts<\/p>\n<h4>4. \u8fd0\u884c\u65b0\u7684 Jenkins \u5bb9\u5668<\/h4>\n<p>\u8fd0\u884c\u65b0\u7684 Jenkins \u5bb9\u5668&#xff0c;\u5e76\u6620\u5c04\u7aef\u53e3\u548c\u6302\u8f7d\u5377&#xff1a;<\/p>\n<p><span class=\"token function\">docker<\/span> run <span class=\"token parameter variable\">-d<\/span> <span class=\"token parameter variable\">&#8211;name<\/span> jenkins <span class=\"token parameter variable\">-p<\/span> <span class=\"token number\">8080<\/span>:8080 <span class=\"token parameter variable\">-p<\/span> <span class=\"token number\">50000<\/span>:50000 <span class=\"token parameter variable\">-v<\/span> jenkins_home:\/var\/jenkins_home jenkins\/jenkins:lts<\/p>\n<ul>\n<li>-d&#xff1a;\u540e\u53f0\u8fd0\u884c\u5bb9\u5668\u3002<\/li>\n<li>&#8211;name jenkins&#xff1a;\u5bb9\u5668\u540d\u79f0\u4e3a jenkins\u3002<\/li>\n<li>-p 8080:8080&#xff1a;\u5c06\u5bb9\u5668\u7684 8080 \u7aef\u53e3\u6620\u5c04\u5230\u4e3b\u673a\u7684 8080 \u7aef\u53e3\u3002<\/li>\n<li>-p 50000:50000&#xff1a;\u5c06\u5bb9\u5668\u7684 50000 \u7aef\u53e3\u6620\u5c04\u5230\u4e3b\u673a\u7684 50000 \u7aef\u53e3\u3002<\/li>\n<li>-v jenkins_home:\/var\/jenkins_home&#xff1a;\u6302\u8f7d\u5377&#xff0c;\u7528\u4e8e\u6301\u4e45\u5316 Jenkins \u6570\u636e\u3002<\/li>\n<\/ul>\n<h4>5. \u67e5\u770b Jenkins \u5bb9\u5668\u72b6\u6001<\/h4>\n<p>\u786e\u8ba4 Jenkins \u5bb9\u5668\u662f\u5426\u6210\u529f\u542f\u52a8&#xff1a;<\/p>\n<p><span class=\"token function\">docker<\/span> <span class=\"token function\">ps<\/span><\/p>\n<p>\u4f60\u5e94\u8be5\u80fd\u770b\u5230 Jenkins \u5bb9\u5668\u6b63\u5728\u8fd0\u884c\u3002<\/p>\n<h4>6. \u8bbf\u95ee Jenkins<\/h4>\n<p>\u5728\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee http:\/\/&lt;your-ip&gt;:8080&#xff0c;\u6309\u7167\u63d0\u793a\u5b8c\u6210 Jenkins \u7684\u521d\u59cb\u8bbe\u7f6e\u3002\u901a\u5e38&#xff0c;\u4f60\u9700\u8981\u8f93\u5165\u521d\u59cb\u7ba1\u7406\u5458\u5bc6\u7801&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u83b7\u53d6&#xff1a;<\/p>\n<p><span class=\"token function\">docker<\/span> <span class=\"token builtin class-name\">exec<\/span> jenkins <span class=\"token function\">cat<\/span> \/var\/jenkins_home\/secrets\/initialAdminPassword<\/p>\n<h4>\u901a\u8fc7nginx\u914d\u7f6e&#xff0c;\u5b9e\u73b0\u57df\u540d\u8bbf\u95eeJenkins<\/h4>\n<ul>\n<li>\u5982\u679c\u4e0d\u914d\u7f6e&#xff0c;\u4f1a\u4ee5http:xxx.com:8080 \u8bbf\u95ee&#xff0c;\u4e0d\u592a\u53cb\u597d&#xff01; \u8981\u5728 Nginx \u4e2d\u914d\u7f6e Jenkins \u4e3a\u56fa\u5b9a\u8def\u5f84&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u53cd\u5411\u4ee3\u7406\u7684\u65b9\u5f0f\u5c06\u7279\u5b9a\u8def\u5f84\u8bf7\u6c42\u8f6c\u53d1\u5230 Jenkins \u670d\u52a1\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u7684\u914d\u7f6e\u6b65\u9aa4&#xff1a;<\/li>\n<\/ul>\n<h4>1. \u5b89\u88c5 Nginx<\/h4>\n<p>\u5982\u679c\u5c1a\u672a\u5b89\u88c5 Nginx&#xff0c;\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> yum <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-y<\/span> epel-release<br \/>\n<span class=\"token function\">sudo<\/span> yum <span class=\"token function\">install<\/span> <span class=\"token parameter variable\">-y<\/span> nginx<\/p>\n<p>\u542f\u52a8 Nginx \u5e76\u8bbe\u7f6e\u4e3a\u5f00\u673a\u542f\u52a8&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> systemctl start nginx<br \/>\n<span class=\"token function\">sudo<\/span> systemctl <span class=\"token builtin class-name\">enable<\/span> nginx<\/p>\n<h4>2. \u914d\u7f6e Nginx \u53cd\u5411\u4ee3\u7406<\/h4>\n<p>\u7f16\u8f91 Nginx \u914d\u7f6e\u6587\u4ef6&#xff0c;\u901a\u5e38\u4f4d\u4e8e \/etc\/nginx\/nginx.conf \u6216 \/etc\/nginx\/conf.d\/ \u76ee\u5f55\u4e0b\u7684\u67d0\u4e2a\u914d\u7f6e\u6587\u4ef6\u3002\u4f8b\u5982&#xff0c;\u7f16\u8f91 \/etc\/nginx\/conf.d\/jenkins.conf \u6587\u4ef6&#xff1a;<\/p>\n<ul>\n<li>\u5982\u679c\u4e0d\u786e\u5b9a\u4f4d\u7f6e&#xff0c;\u53ef\u4ee5\u901a\u8fc7find\u547d\u4ee4\u67e5\u8be2&#xff1a;<\/li>\n<\/ul>\n<p><span class=\"token function\">find<\/span> \/ <span class=\"token parameter variable\">-iname<\/span> nginx.conf<br \/>\n<span class=\"token comment\"># \u7ed3\u679c \u7504\u522b\u770b\u4e0b\u662f\u54ea\u4e2a\u914d\u7f6e<\/span><br \/>\n<span class=\"token comment\"># \/usr\/local\/nginx\/conf\/nginx.conf<\/span><br \/>\n<span class=\"token comment\"># \/usr\/local\/nginx-1.27.2\/conf\/nginx.conf<\/span><\/p>\n<p>\u6211\u7684\u662f\u7b2c\u4e00\u4e2a&#xff0c;\u56e0\u4e3a\u6211\u91c7\u7528\u5b89\u88c5\u5305\u7684\u65b9\u5f0f\u5b89\u88c5\u7684&#xff0c;\u4e0d\u5728\/etc\u4e0b<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">vi<\/span> \/usr\/local\/nginx\/conf\/nginx.conf<\/p>\n<p>\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9&#xff1a;<\/p>\n<ul>\n<li>\u5982\u679c\u4ee5\u524d\u6709\u914d\u7f6e\u5176\u4ed6server\u4ee3\u7406&#xff0c;\u5efa\u8bae\u65b0\u52a0\u4e00\u4e2aserver\u914d\u7f6e&#xff0c;\u4ee5\u514d\u8bbf\u95ee\u6df7\u6dc6\u9519\u4e71<\/li>\n<\/ul>\n<p>server {<br \/>\n    listen 80;<br \/>\n    server_name your-domain.com;<\/p>\n<p>    location \/ {<br \/>\n        proxy_pass http:\/\/localhost:8080\/;<br \/>\n        proxy_set_header Host $host;<br \/>\n        proxy_set_header X-Real-IP $remote_addr;<br \/>\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br \/>\n        proxy_set_header X-Forwarded-Proto $scheme;<br \/>\n    }<br \/>\n}<\/p>\n<p>\u8bf7\u5c06 your-domain.com \u66ff\u6362\u4e3a\u4f60\u7684\u5b9e\u9645\u57df\u540d\u3002\u4e4b\u540e\u76f4\u63a5\u8bbf\u95ee\u5373\u66ff\u6362\u6700\u521d\u7684http:xxx.com:8080\u7684\u8bbf\u95ee\u65b9\u5f0f&#xff01;<\/p>\n<h4>3. \u6d4b\u8bd5 Nginx \u914d\u7f6e<\/h4>\n<p>\u4fdd\u5b58\u5e76\u9000\u51fa\u7f16\u8f91\u5668&#xff0c;\u7136\u540e\u6d4b\u8bd5 Nginx \u914d\u7f6e\u662f\u5426\u6b63\u786e&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> nginx <span class=\"token parameter variable\">-t<\/span><\/p>\n<p>\u5982\u679c\u6ca1\u6709\u9519\u8bef&#xff0c;\u91cd\u65b0\u52a0\u8f7d Nginx&#xff1a;<\/p>\n<p> nginx <span class=\"token parameter variable\">-s<\/span> reload<\/p>\n<h4>4. \u8bbf\u95ee Jenkins<\/h4>\n<p>\u5728\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee http:\/\/your-domain.com\/jenkins\/&#xff0c;\u5373\u53ef\u901a\u8fc7 Nginx \u8bbf\u95ee Jenkins \u670d\u52a1\u3002<\/p>\n<h4>5. \u91cd\u542fJenkins \u670d\u52a1<\/h4>\n<p>\u4fdd\u5b58\u5e76\u9000\u51fa\u7f16\u8f91\u5668&#xff0c;\u7136\u540e\u91cd\u542f Jenkins \u670d\u52a1&#xff1a;<\/p>\n<p><span class=\"token function\">docker<\/span> restart jenkins <span class=\"token comment\">#\u4e2a\u4eba\u4f7f\u7528docker\u7ba1\u7406\u7684&#xff0c;\u6240\u4ee5doker\u91cd\u542f<\/span><\/p>\n<h4>\u5f53\u7136&#xff0c;\u64cd\u4f5c\u8fc7\u7a0b\u4e2d\u4f1a\u9047\u5230\u4e00\u4e9b\u95ee\u9898&#xff1a;<\/h4>\n<h4><font color=\"red\">\u95ee\u98981.<\/font> \u62c9\u53d6 Jenkins \u955c\u50cf\u65f6&#xff0c;\u9ed8\u8ba4\u7684docker\u955c\u50cf\u6e90\u901f\u5ea6\u6781\u6162&#xff0c;\u9700\u8981\u66f4\u6362\u955c\u50cf\u6e90<\/h4>\n<p>\u8981\u5c06 Docker \u955c\u50cf\u6e90\u6539\u4e3a\u963f\u91cc\u4e91\u955c\u50cf\u6e90&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e Docker \u7684\u955c\u50cf\u52a0\u901f\u5668\u6765\u5b9e\u73b0\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u7684\u6b65\u9aa4&#xff1a;<\/p>\n<h5>1. \u6ce8\u518c\u963f\u91cc\u4e91\u8d26\u53f7\u5e76\u83b7\u53d6\u955c\u50cf\u52a0\u901f\u5668\u5730\u5740<\/h5>\n<p>\u9996\u5148&#xff0c;\u786e\u4fdd\u4f60\u6709\u4e00\u4e2a\u963f\u91cc\u4e91\u8d26\u53f7\u3002\u767b\u5f55\u963f\u91cc\u4e91\u63a7\u5236\u53f0&#xff0c;\u627e\u5230\u5bb9\u5668\u955c\u50cf\u670d\u52a1&#xff08;ACR&#xff09;&#xff0c;\u7136\u540e\u83b7\u53d6\u955c\u50cf\u52a0\u901f\u5668\u5730\u5740\u3002\u901a\u5e38&#xff0c;\u963f\u91cc\u4e91\u4f1a\u63d0\u4f9b\u4e00\u4e2a\u7c7b\u4f3c https:\/\/&lt;your-accelerator-id&gt;.mirror.aliyuncs.com \u7684\u5730\u5740\u3002<\/p>\n<ul>\n<li>\u8fd9\u91cc\u9644\u4e00\u4e2a\u5bf9\u5e94\u5730\u5740&#xff1a;\u963f\u91cc\u4e91\u955c\u50cf\u52a0\u901f\u670d\u52a1\u5730\u5740<\/li>\n<li>\u6839\u636e\u5730\u5740\u5185\u7684\u4e0d\u540c\u670d\u52a1\u5668&#xff0c;\u53bb\u8fd0\u884c\u5bf9\u5e94\u547d\u4ee4\u6dfb\u52a0\u66f4\u6362\u955c\u50cf\u6e90\u5373\u53ef&#xff01;<\/li>\n<li>\u4ee5\u4e0b\u662fcentos\u7248\u672c\u7684\u547d\u4ee4&#xff0c;\u5373\u62ff\u5373\u7528&#xff1a;&#xff08;\u4f7f\u7528\u6b64\u547d\u4ee4\u5219\u5ffd\u7565\u6b65\u9aa42&#xff09;<\/li>\n<\/ul>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">mkdir<\/span> <span class=\"token parameter variable\">-p<\/span> \/etc\/docker<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">tee<\/span> \/etc\/docker\/daemon.json <span class=\"token operator\">&lt;&lt;-<\/span><span class=\"token string\">&#039;EOF&#039;<br \/>\n{<br \/>\n  &#034;registry-mirrors&#034;: [&#034;https:\/\/u2vy1ijp.mirror.aliyuncs.com&#034;]<br \/>\n}<br \/>\nEOF<\/span><br \/>\n<span class=\"token function\">sudo<\/span> systemctl daemon-reload<br \/>\n<span class=\"token function\">sudo<\/span> systemctl restart <span class=\"token function\">docker<\/span><\/p>\n<h5>2. \u914d\u7f6e Docker \u4f7f\u7528\u963f\u91cc\u4e91\u955c\u50cf\u52a0\u901f\u5668<\/h5>\n<p>\u7f16\u8f91 Docker \u7684\u914d\u7f6e\u6587\u4ef6 \/etc\/docker\/daemon.json&#xff0c;\u6dfb\u52a0\u955c\u50cf\u52a0\u901f\u5668\u8bbe\u7f6e&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">vi<\/span> \/etc\/docker\/daemon.json<\/p>\n<p>\u5728\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9&#xff1a;<\/p>\n<p><span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token string-property property\">&#034;registry-mirrors&#034;<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">&#034;https:\/\/&lt;your-accelerator-id&gt;.mirror.aliyuncs.com&#034;<\/span><span class=\"token punctuation\">]<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u5c06 &lt;your-accelerator-id&gt; \u66ff\u6362\u4e3a\u4f60\u4ece\u963f\u91cc\u4e91\u83b7\u53d6\u7684\u5b9e\u9645\u52a0\u901f\u5668 ID\u3002<\/p>\n<h5>3. \u91cd\u542f Docker \u670d\u52a1<\/h5>\n<p>\u4fdd\u5b58\u5e76\u9000\u51fa\u7f16\u8f91\u5668&#xff0c;\u7136\u540e\u91cd\u542f Docker \u670d\u52a1\u4ee5\u4f7f\u914d\u7f6e\u751f\u6548&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> systemctl restart <span class=\"token function\">docker<\/span><\/p>\n<h5>4. \u9a8c\u8bc1\u914d\u7f6e<\/h5>\n<p>\u91cd\u542f Docker \u670d\u52a1\u540e&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u9a8c\u8bc1\u914d\u7f6e\u662f\u5426\u751f\u6548&#xff1a;<\/p>\n<p><span class=\"token function\">docker<\/span> info<\/p>\n<p>\u5728\u8f93\u51fa\u4fe1\u606f\u4e2d\u67e5\u627e Registry Mirrors&#xff0c;\u786e\u4fdd\u52a0\u901f\u5668\u5730\u5740\u6b63\u786e\u914d\u7f6e\u3002<\/p>\n<h5>5. \u6d4b\u8bd5\u62c9\u53d6\u955c\u50cf<\/h5>\n<p>\u5c1d\u8bd5\u62c9\u53d6\u4e00\u4e2a\u955c\u50cf&#xff0c;\u9a8c\u8bc1\u52a0\u901f\u5668\u662f\u5426\u6b63\u5e38\u5de5\u4f5c&#xff1a;<\/p>\n<p><span class=\"token function\">docker<\/span> pull nginx:latest<\/p>\n<p>\u5982\u679c\u914d\u7f6e\u6b63\u786e&#xff0c;\u62c9\u53d6\u901f\u5ea6\u5e94\u8be5\u4f1a\u6709\u6240\u63d0\u5347\u3002<\/p>\n<h5>6. \u5e38\u89c1\u95ee\u9898\u6392\u67e5<\/h5>\n<p>\u5982\u679c\u5728\u914d\u7f6e\u8fc7\u7a0b\u4e2d\u9047\u5230\u95ee\u9898&#xff0c;\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u5e38\u89c1\u95ee\u9898\u6392\u67e5\u6b65\u9aa4&#xff1a;<\/p>\n<ul>\n<li>\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5&#xff1a;\u786e\u4fdd\u7cfb\u7edf\u6709\u7a33\u5b9a\u7684\u7f51\u7edc\u8fde\u63a5\u3002<\/li>\n<li>\u68c0\u67e5\u914d\u7f6e\u6587\u4ef6&#xff1a;\u786e\u4fdd daemon.json \u6587\u4ef6\u683c\u5f0f\u6b63\u786e&#xff0c;\u6ca1\u6709\u8bed\u6cd5\u9519\u8bef\u3002<\/li>\n<li>\u68c0\u67e5 Docker \u670d\u52a1\u72b6\u6001&#xff1a;\u786e\u4fdd Docker \u670d\u52a1\u6b63\u5728\u8fd0\u884c\u3002<\/li>\n<li>\u68c0\u67e5\u9632\u706b\u5899\u8bbe\u7f6e&#xff1a;\u786e\u4fdd\u9632\u706b\u5899\u6ca1\u6709\u963b\u6b62 Docker \u7684\u7f51\u7edc\u8bf7\u6c42\u3002<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4&#xff0c;\u4f60\u53ef\u4ee5\u5c06 Docker \u955c\u50cf\u6e90\u6539\u4e3a\u963f\u91cc\u4e91\u955c\u50cf\u6e90&#xff0c;\u4ece\u800c\u63d0\u9ad8\u955c\u50cf\u62c9\u53d6\u901f\u5ea6\u548c\u7a33\u5b9a\u6027\u3002\u5e0c\u671b\u8fd9\u4e9b\u4fe1\u606f\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9&#xff01;<\/p>\n<h4><font color=\"red\">\u95ee\u98982.<\/font> \u5728\u7f51\u9875\u8bbf\u95eeJenkins\u65f6&#xff0c;\u4e0d\u77e5\u9053\u521d\u59cb\u5bc6\u7801\u5982\u4f55\u83b7\u53d6<\/h4>\n<ul>\n<li>\u5f53\u7136\u76f4\u63a5\u4f7f\u7528\u4e5f\u662f\u53ef\u4ee5\u7684&#xff1a; <\/li>\n<\/ul>\n<p>docker exec jenkins cat \/var\/jenkins_home\/secrets\/initialAdminPassword<\/p>\n<p>![\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0](https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250512120106-6821e302d3461.png)<br \/>\n1. \u8fd9\u91cc\u76f4\u63a5\u5728\u670d\u52a1\u5668\u4f7f\u7528,\u662f\u62ff\u4e0d\u5230\u7684&#xff1a;<br \/>\n&#096;&#096;&#096;bash<br \/>\ncd \/var\/jenkins_home\/secrets\/initialAdminPassword<\/p>\n<p>\u8bf7\u6839\u636e\u4ee5\u4e0b\u6b65\u9aa4\u62ff\u53d6\u521d\u59cb\u5bc6\u7801&#xff1a; \u5f53 Jenkins \u7ba1\u7406\u5458\u5bc6\u7801\u4e0d\u5728 \/var\/jenkins_home\/secrets\/initialAdminPassword \u6587\u4ef6\u4e2d\u65f6&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u6765\u5904\u7406&#xff1a;<\/p>\n<h4>1. \u68c0\u67e5 Jenkins \u65e5\u5fd7<\/h4>\n<p>\u9996\u5148&#xff0c;\u68c0\u67e5 Jenkins \u7684\u65e5\u5fd7\u6587\u4ef6&#xff0c;\u4ee5\u83b7\u53d6\u66f4\u591a\u5173\u4e8e\u542f\u52a8\u5931\u8d25\u7684\u4fe1\u606f&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">tail<\/span> <span class=\"token parameter variable\">-f<\/span> \/var\/log\/jenkins\/jenkins.log<\/p>\n<p>\u5982\u679c\u65e5\u5fd7\u6587\u4ef6\u4e0d\u5b58\u5728&#xff0c;\u53ef\u4ee5\u624b\u52a8\u542f\u52a8 Jenkins \u5e76\u67e5\u770b\u63a7\u5236\u53f0\u8f93\u51fa&#xff1a;<\/p>\n<p><span class=\"token function\">sudo<\/span> systemctl start jenkins<br \/>\n<span class=\"token function\">sudo<\/span> journalctl <span class=\"token parameter variable\">-u<\/span> jenkins <span class=\"token parameter variable\">-f<\/span><\/p>\n<h4>2. \u91cd\u7f6e Jenkins \u7ba1\u7406\u5458\u5bc6\u7801<\/h4>\n<p>\u5982\u679c Jenkins \u5df2\u7ecf\u542f\u52a8&#xff0c;\u4f46\u627e\u4e0d\u5230\u7ba1\u7406\u5458\u5bc6\u7801&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u91cd\u7f6e\u5bc6\u7801&#xff1a;<\/p>\n<h5>1. \u8fdb\u5165 Jenkins \u5bb9\u5668<\/h5>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u5165 Jenkins \u5bb9\u5668&#xff1a;<\/p>\n<p><span class=\"token function\">docker<\/span> <span class=\"token builtin class-name\">exec<\/span> <span class=\"token parameter variable\">-it<\/span> jenkins <span class=\"token function\">bash<\/span><\/p>\n<h5>2. \u8fdb\u5165 Jenkins \u7528\u6237\u76ee\u5f55<\/h5>\n<p>\u8fdb\u5165 Jenkins \u7528\u6237\u76ee\u5f55&#xff1a;<\/p>\n<p><span class=\"token builtin class-name\">cd<\/span> \/var\/jenkins_home<\/p>\n<h5>3. \u751f\u6210\u65b0\u5bc6\u7801<\/h5>\n<ul>\n<li>\u53ef\u5148\u8df3\u8fc7\u8be5\u6b65\u9aa4&#xff0c;\u6267\u884c4&#xff0c;\u5982\u679c\u6ca1\u6709\u5728\u56de\u6765\u6267\u884c\u6b65\u9aa43 &amp; 4 \u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u751f\u6210\u65b0\u5bc6\u7801&#xff1a;<\/li>\n<\/ul>\n<p><span class=\"token builtin class-name\">printf<\/span> <span class=\"token variable\"><span class=\"token variable\">$(<\/span>openssl rand <span class=\"token parameter variable\">-base64<\/span> <span class=\"token number\">15<\/span><span class=\"token variable\">)<\/span><\/span><\/p>\n<p>\u8bb0\u4e0b\u751f\u6210\u7684\u5bc6\u7801\u3002<\/p>\n<h5>4. \u76f4\u63a5\u5728 \/var\/jenkins_home \u76ee\u5f55\u4e2d\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u53ef\u4ee5\u83b7\u53d6\u5bc6\u7801&#xff1a;<\/h5>\n<p><span class=\"token builtin class-name\">cd<\/span> \/var\/jenkins_home\/secrets\/initialAdminPassword<\/p>\n<h4>\u603b\u7ed3<\/h4>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4&#xff0c;\u4f60\u53ef\u4ee5\u4f7f\u7528 Docker \u5b89\u88c5\u5e76\u7ba1\u7406 Jenkins\u3002Docker \u63d0\u4f9b\u4e86\u7075\u6d3b\u4e14\u53ef\u79fb\u690d\u7684\u65b9\u5f0f\u6765\u90e8\u7f72\u548c\u7ba1\u7406 Jenkins \u670d\u52a1\u3002\u5e0c\u671b\u8fd9\u4e9b\u4fe1\u606f\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.3k\u6b21\uff0c\u70b9\u8d5e16\u6b21\uff0c\u6536\u85cf15\u6b21\u3002\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 Docker \u5b89\u88c5\u5e76\u7ba1\u7406 Jenkins\u3002Docker \u63d0\u4f9b\u4e86\u7075\u6d3b\u4e14\u53ef\u79fb\u690d\u7684\u65b9\u5f0f\u6765\u90e8\u7f72\u548c\u7ba1\u7406 Jenkins \u670d\u52a1\u3002\u5e0c\u671b\u8fd9\u4e9b\u4fe1\u606f\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff01_centos \u4e0a\u9762\u5b89\u88c5\u6709python\u548cyum\u547d\u4ee4,\u4f46\u4f7f\u7528docker \u5b89\u88c5\u7684jenkins,\u5728\u6784\u5efa\u9879\u76ee\u6267\u884csh<\/p>\n","protected":false},"author":2,"featured_media":36861,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[59,27,392,43,2579],"topic":[],"class_list":["post-36862","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-centos","tag-docker","tag-jenkins","tag-43","tag-2579"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u670d\u52a1\u5668-centos\u4e0a\u5b89\u88c5docker\u5e76\u4f7f\u7528docker\u914d\u7f6ejenkins - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/36862.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u670d\u52a1\u5668-centos\u4e0a\u5b89\u88c5docker\u5e76\u4f7f\u7528docker\u914d\u7f6ejenkins - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.3k\u6b21\uff0c\u70b9\u8d5e16\u6b21\uff0c\u6536\u85cf15\u6b21\u3002\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 Docker \u5b89\u88c5\u5e76\u7ba1\u7406 Jenkins\u3002Docker \u63d0\u4f9b\u4e86\u7075\u6d3b\u4e14\u53ef\u79fb\u690d\u7684\u65b9\u5f0f\u6765\u90e8\u7f72\u548c\u7ba1\u7406 Jenkins \u670d\u52a1\u3002\u5e0c\u671b\u8fd9\u4e9b\u4fe1\u606f\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff01_centos \u4e0a\u9762\u5b89\u88c5\u6709python\u548cyum\u547d\u4ee4,\u4f46\u4f7f\u7528docker \u5b89\u88c5\u7684jenkins,\u5728\u6784\u5efa\u9879\u76ee\u6267\u884csh\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/36862.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-12T12:01:09+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/36862.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/36862.html\",\"name\":\"\u670d\u52a1\u5668-centos\u4e0a\u5b89\u88c5docker\u5e76\u4f7f\u7528docker\u914d\u7f6ejenkins - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-12T12:01:09+00:00\",\"dateModified\":\"2025-05-12T12:01:09+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/36862.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/36862.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/36862.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u670d\u52a1\u5668---centos\u4e0a\u5b89\u88c5docker\u5e76\u4f7f\u7528docker\u914d\u7f6ejenkins\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u670d\u52a1\u5668-centos\u4e0a\u5b89\u88c5docker\u5e76\u4f7f\u7528docker\u914d\u7f6ejenkins - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/36862.html","og_locale":"zh_CN","og_type":"article","og_title":"\u670d\u52a1\u5668-centos\u4e0a\u5b89\u88c5docker\u5e76\u4f7f\u7528docker\u914d\u7f6ejenkins - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.3k\u6b21\uff0c\u70b9\u8d5e16\u6b21\uff0c\u6536\u85cf15\u6b21\u3002\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 Docker \u5b89\u88c5\u5e76\u7ba1\u7406 Jenkins\u3002Docker \u63d0\u4f9b\u4e86\u7075\u6d3b\u4e14\u53ef\u79fb\u690d\u7684\u65b9\u5f0f\u6765\u90e8\u7f72\u548c\u7ba1\u7406 Jenkins \u670d\u52a1\u3002\u5e0c\u671b\u8fd9\u4e9b\u4fe1\u606f\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff01_centos \u4e0a\u9762\u5b89\u88c5\u6709python\u548cyum\u547d\u4ee4,\u4f46\u4f7f\u7528docker \u5b89\u88c5\u7684jenkins,\u5728\u6784\u5efa\u9879\u76ee\u6267\u884csh","og_url":"https:\/\/www.wsisp.com\/helps\/36862.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-12T12:01:09+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/36862.html","url":"https:\/\/www.wsisp.com\/helps\/36862.html","name":"\u670d\u52a1\u5668-centos\u4e0a\u5b89\u88c5docker\u5e76\u4f7f\u7528docker\u914d\u7f6ejenkins - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-12T12:01:09+00:00","dateModified":"2025-05-12T12:01:09+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/36862.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/36862.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/36862.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u670d\u52a1\u5668---centos\u4e0a\u5b89\u88c5docker\u5e76\u4f7f\u7528docker\u914d\u7f6ejenkins"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/36862","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=36862"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/36862\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/36861"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=36862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=36862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=36862"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=36862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}