{"id":488,"date":"2020-09-17T11:03:02","date_gmt":"2020-09-17T03:03:02","guid":{"rendered":"http:\/\/www.mimiq.com.cn\/?p=488"},"modified":"2020-09-17T11:03:02","modified_gmt":"2020-09-17T03:03:02","slug":"deepops%e7%9a%84jenkins%e5%b0%8f%e7%ac%94%e8%ae%b0-%e6%90%ad%e5%bb%bajenkins","status":"publish","type":"post","link":"http:\/\/www.mimiq.com.cn\/?p=488","title":{"rendered":"DeepOps\u7684Jenkins\u5c0f\u7b14\u8bb0-\u642d\u5efajenkins"},"content":{"rendered":"\n<p>\u5b98\u7f51\u4e2d\u6587\u7ad9\u7684\u6559\u7a0b<\/p>\n\n\n\n<p><a href=\"https:\/\/www.jenkins.io\/zh\/doc\/pipeline\/tour\/getting-started\/\">https:\/\/www.jenkins.io\/zh\/doc\/pipeline\/tour\/getting-started\/<\/a><\/p>\n\n\n\n<h2 id=\"\u4e0b\u8f7d\u5e76\u8fd0\u884c-jenkins\">\u65b9\u5f0f1\uff1a\u4e0b\u8f7d\u5e76\u8fd0\u884c Jenkins<\/h2>\n\n\n\n<p>\u6ce8\u610f\u8fd0\u884cjenkins\u7684jdk\u7248\u672c8\u621611 <\/p>\n\n\n\n<ol><li><a href=\"http:\/\/mirrors.jenkins.io\/war-stable\/latest\/jenkins.war\">\u4e0b\u8f7d Jenkins<\/a>.<\/li><li>\u6253\u5f00\u7ec8\u7aef\u8fdb\u5165\u5230\u4e0b\u8f7d\u76ee\u5f55.<\/li><li>\u8fd0\u884c\u547d\u4ee4\u00a0<code>java -jar jenkins.war --httpPort=8080<\/code>.<\/li><li>\u6253\u5f00\u6d4f\u89c8\u5668\u8fdb\u5165\u94fe\u63a5\u00a0<code>http:\/\/localhost:8080<\/code>.<\/li><li>\u6309\u7167\u8bf4\u660e\u5b8c\u6210\u5b89\u88c5.<\/li><\/ol>\n\n\n\n<p><a href=\"http:\/\/localhost:8080\/jks\">http:\/\/localhost:8080\/jks<\/a><\/p>\n\n\n\n<h2>\u65b9\u5f0f2\uff1a docker\u5b89\u88c5jenkins<\/h2>\n\n\n\n<p><a href=\"https:\/\/www.jenkins.io\/doc\/book\/installing\/\">https:\/\/www.jenkins.io\/doc\/book\/installing\/<\/a><\/p>\n\n\n\n<p>\u6309\u987a\u5e8f\u4e00\u8def\u64cd\u4f5c\u5373\u53ef\uff0c\u5982\u679c\u6709\u6743\u9650\u95ee\u9898\uff0c\u52a0\u4e0asudo<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker network create jenkins\ndocker volume create jenkins-docker-certs\ndocker volume create jenkins-data<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>docker container run \\\n  --name jenkins-docker \\\n  --rm \\\n  --detach \\\n  --privileged \\\n  --network jenkins \\\n  --network-alias docker \\\n  --env DOCKER_TLS_CERTDIR=\/certs \\\n  --volume jenkins-docker-certs:\/certs\/client \\\n  --volume jenkins-data:\/var\/jenkins_home \\\n  --publish 2376:2376 \\\n  docker:dind<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>docker container run \\\n  --name jenkins-blueocean \\\n  --rm \\\n  --detach \\\n  --network jenkins \\\n  --env DOCKER_HOST=tcp:\/\/docker:2376 \\\n  --env DOCKER_CERT_PATH=\/certs\/client \\\n  --env DOCKER_TLS_VERIFY=1 \\\n  --publish 8080:8080 \\\n  --publish 50000:50000 \\\n  --volume jenkins-data:\/var\/jenkins_home \\\n  --volume jenkins-docker-certs:\/certs\/client:ro \\\n  jenkinsci\/blueocean<\/code><\/pre>\n\n\n\n<h2>\u521d\u59cb\u5316jenkins<\/h2>\n\n\n\n<h3 id=\"unlocking-jenkins\">Unlocking Jenkins<\/h3>\n\n\n\n<p>When you first access a new Jenkins instance, you are asked to unlock it using an automatically-generated password.<\/p>\n\n\n\n<ol><li>Browse to&nbsp;<code>http:\/\/localhost:8080<\/code>&nbsp;(or whichever port you configured for Jenkins when installing it) and wait until the&nbsp;<strong>Unlock Jenkins<\/strong>&nbsp;page appears.<\/li><\/ol>\n\n\n\n<h1>Unlock Jenkins<\/h1>\n\n\n\n<p>To ensure Jenkins is securely set up by the administrator, a password has been written to the log (<small><a rel=\"noreferrer noopener\" href=\"https:\/\/jenkins.io\/redirect\/find-jenkins-logs\" target=\"_blank\">not sure where to find it?<\/a><\/small>) and this file on the server:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>\u6700\u4e3b\u8981\u7684\u5c31\u662f\u627e\u5230\u8fd9\u4e2a\u5bc6\u7801\uff0c\u7136\u540e\u8f93\u5165\u3002\u53e6\u5916\u6839\u636e\u63d0\u793a\u4e0b\u8f7d\u63d2\u4ef6\uff0c\u521b\u5efa\u7528\u6237\u7b97\u662f\u5b8c\u6210\u4e86\u57fa\u672c\u8bbe\u7f6e\u3002<\/p><\/blockquote>\n\n\n\n<p><strong>\u4f7f\u7528war\u5305\u5b89\u88c5\uff1a<\/strong><small><code>\/var\/jenkins_home\/secrets\/initialAdminPassword<\/code><\/small><\/p>\n\n\n\n<p><strong>\u4f7f\u7528docker \u5b89\u88c5 \uff1a<\/strong>\/var\/lib\/docker\/volumes\/jenkins-data\/_data\/secrets\/<small><code>initialAdminPassword<\/code><\/small><\/p>\n\n\n\n<p>Please copy the password from either location and paste it below.Administrator password<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b98\u7f51\u4e2d\u6587\u7ad9\u7684\u6559\u7a0b https:\/\/www.jenkins.io\/zh\/doc\/pipeline\/tour\/getting-started\/ \u65b9\u5f0f1\uff1a\u4e0b\u8f7d\u5e76\u8fd0\u884c Jenkins \u6ce8\u610f\u8fd0\u884cjenkins\u7684jdk\u7248\u672c8\u621611 \u4e0b\u8f7d Jenkins. \u6253\u5f00\u7ec8\u7aef\u8fdb\u5165\u5230\u4e0b\u8f7d\u76ee\u5f55. \u8fd0\u884c\u547d\u4ee4\u00a0java -jar jenkins.war &#8211;httpPort=8080. \u6253\u5f00\u6d4f\u89c8\u5668\u8fdb\u5165\u94fe\u63a5\u00a0http:\/\/localhost:8080. \u6309\u7167\u8bf4\u660e\u5b8c\u6210\u5b89\u88c5. http:\/\/localhost:8080\/jks \u65b9\u5f0f2\uff1a docker\u5b89\u88c5jenkins https:\/\/www.jenkins.io\/doc\/book\/installing\/ \u6309\u987a\u5e8f\u4e00\u8def\u64cd\u4f5c\u5373\u53ef\uff0c\u5982\u679c\u6709\u6743\u9650\u95ee\u9898\uff0c\u52a0\u4e0asudo \u521d\u59cb\u5316jenkins Unlocking Jenkins When you first access a new Jenkins instance, you are asked to unlock it using an automatically-generated password. Browse to&nbsp;http:\/\/localhost:8080&nbsp;(or whichever port you configured for Jenkins when installing it) and wait until the&nbsp;Unlock &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"http:\/\/www.mimiq.com.cn\/?p=488\"> <span class=\"screen-reader-text\">DeepOps\u7684Jenkins\u5c0f\u7b14\u8bb0-\u642d\u5efajenkins<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[],"_links":{"self":[{"href":"http:\/\/www.mimiq.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/488"}],"collection":[{"href":"http:\/\/www.mimiq.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.mimiq.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.mimiq.com.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.mimiq.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=488"}],"version-history":[{"count":23,"href":"http:\/\/www.mimiq.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/488\/revisions"}],"predecessor-version":[{"id":511,"href":"http:\/\/www.mimiq.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/488\/revisions\/511"}],"wp:attachment":[{"href":"http:\/\/www.mimiq.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=488"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.mimiq.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=488"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.mimiq.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}