{"id":11,"date":"2021-03-20T02:10:00","date_gmt":"2021-03-20T02:10:00","guid":{"rendered":"https:\/\/262235.xyz\/?p=11"},"modified":"2021-03-20T02:10:00","modified_gmt":"2021-03-20T02:10:00","slug":"11","status":"publish","type":"post","link":"https:\/\/lyvba.com\/index.php\/2021\/03\/20\/11\/","title":{"rendered":"Docker \u642d\u5efaPortainer\u53ef\u89c6\u5316\u754c\u9762-\u535a\u5ba2Blog-Pt\u4e0b\u8f7d\u8f6f\u4ef6\u7b14\u8bb0"},"content":{"rendered":"<h2>Docker \u642d\u5efaPortainer\u53ef\u89c6\u5316\u754c\u9762<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2021\/03\/546180361.png\" alt=\"portainer.png\" title=\"portainer.png\"><br \/>Portainer\u662fDocker\u7684\u56fe\u5f62\u5316\u7ba1\u7406\u5de5\u5177\uff0c\u63d0\u4f9b\u72b6\u6001\u663e\u793a\u9762\u677f\u3001\u5e94\u7528\u6a21\u677f\u5feb\u901f\u90e8\u7f72\u3001<br \/>\u5bb9\u5668\u955c\u50cf\u7f51\u7edc\u6570\u636e\u5377\u7684\u57fa\u672c\u64cd\u4f5c\uff08\u5305\u62ec\u4e0a\u4f20\u4e0b\u8f7d\u955c\u50cf\uff0c\u521b\u5efa\u5bb9\u5668\u7b49\u64cd\u4f5c\uff09\u3001\u4e8b\u4ef6\u65e5\u5fd7\u663e\u793a\u3001<br \/>\u5bb9\u5668\u63a7\u5236\u53f0\u64cd\u4f5c\u3001Swarm\u96c6\u7fa4\u548c\u670d\u52a1\u7b49\u96c6\u4e2d\u7ba1\u7406\u548c\u64cd\u4f5c\u3001\u767b\u5f55\u7528\u6237\u7ba1\u7406\u548c\u63a7\u5236\u7b49\u529f\u80fd\u3002<\/p>\n<h3>\u67e5\u8be2\u5f53\u524d\u6709\u54ea\u4e9bPortainer\u955c\u50cf<\/h3>\n<pre><code>docker search portainer\n<\/code><\/pre>\n<h3>\u5b89\u88c5Docker\u53ef\u89c6\u5316\u754c\u9762Portainer<\/h3>\n<pre><code>docker run --name Portainer          \\r\n  --restart=always  -d -p 9000:9000  \\r\n  -v \/var\/run\/docker.sock:\/var\/run\/docker.sock  \\r\n  -v \/opt\/portainer_data:\/data        \\r\n  portainer\/portainer<\/code><\/pre>\n<h3>\u5220\u9664Portainer\u670d\u52a1<\/h3>\n<pre><code>docker rm  -f Portainer\ndocker rmi portainer\/portainer\n<\/code><\/pre>\n<hr \/>\n<h2>Docker \u5b89\u88c5\u548c\u8fd0\u884c Nginx<\/h2>\n<pre><code># \u5b89\u88c5Docker\u8f6f\u4ef6\u4e00\u952e\u811a\u672c\ncurl -fsSLo- get.docker.com | \/bin\/sh<\/code><\/pre>\n<h3>Docker \u62c9\u53d6\u6700\u65b0\u7248\u7684 Nginx \u955c\u50cf<\/h3>\n<p>docker pull nginx:latest<\/p>\n<h3>\u8fd0\u884cnginx-web\u5bb9\u5668,<\/h3>\n<pre><code>docker run --rm -d -p 80:80 --name nginx-web \\r\n  -v \/var\/www\/html:\/usr\/share\/nginx\/html \\r\n  nginx<\/code><\/pre>\n<hr \/>\n<pre><code># --rm \u7ed3\u675f\u5220\u9664\u5bb9\u5668\uff0c-d \u540e\u53f0\u8fd0\u884c\uff0c-p 80:80 \u6620\u5c04\u7aef\u53e3 \u672c\u5730:\u5bb9\u5668\n# -v \/var\/www\/html:\/usr\/share\/nginx\/html \u672c\u5730\u76ee\u5f55\/var\/www\/html \u6620\u5c04\u5230 \/usr\/share\/nginx\/html<\/code><\/pre>\n<h3>HTML5 \u6d4b\u901f<\/h3>\n<pre><code>docker run -d -p 8888:80  --name  html5speed \\r\n          --cpus 0.5    --restart=always     \\r\n          ilemonrain\/html5-speedtest:alpine<\/code><\/pre>\n<h3>\u767b\u5165nginx-web \u5bb9\u5668\u67e5\u770b<\/h3>\n<p>docker exec -it  nginx-web  \/bin\/bash<\/p>\n<h3>\u5b9e\u9645\u90e8\u7f72\uff0c\u670d\u52a1\u5668\u91cd\u542f\uff0cnginx-web \u5bb9\u5668 \u4e5f\u81ea\u52a8\u8fd0\u884c<\/h3>\n<pre><code>docker run -d -p 80:80 --name  nginx-web \\r\n    --cpus 0.5   --restart=always          \\r\n    -v \/var\/www:\/usr\/share\/nginx\/html      \\r\n    nginx\n\n## --restart=always    \u53c2\u6570\u80fd\u591f\u4f7f\u6211\u4eec\u5728\u91cd\u542fdocker\u65f6\uff0c\u81ea\u52a8\u542f\u52a8\u76f8\u5173\u5bb9\u5668\n## --cpus 0.3\n\ndocker stats        # \u67e5\u770b\u5bb9\u5668\u8fd0\u884c\u60c5\u51b5\n\nCONTAINER ID        NAME                CPU %               MEM USAGE \/ LIMIT     MEM %               NET I\/O             BLOCK I\/O           PIDS\n8d025484dd41        nginx-web           0.00%               2.391MiB \/ 420.4MiB   0.57%               16.8kB \/ 64.5kB     11MB \/ 0B           2<\/code><\/pre>\n<hr \/>\n<h3>\u90e8\u7f72 nginx-php7 \u548c php \u76f8\u518c<\/h3>\n<pre><code>docker run -d -p 80:80 --name  nginx-web \\r\n    --cpus 0.5   --restart=always     \\r\n    -v \/mnt\/downloads:\/data\/wwwroot     \\r\n    skiychan\/nginx-php7\n\ndownloads=\/mnt\/downloads\n\ncd  ${downloads}\nwget https:\/\/github.com\/hongwenjun\/srgb\/raw\/master\/files.photo.gallery\/index.php\nmkdir -p _files\nchown -R www-data:www-data  _files\nchmod 0777 _files\/\n<\/code><\/pre>\n<hr \/>\n<h2>Docker \u5b89\u88c5 WordPress \u535a\u5ba2\u7a0b\u5e8f<\/h2>\n<pre><code>#  wordpress \u5b89\u88c5\u76ee\u5f55\u548c\u7a0b\u5e8f\u4e0b\u8f7d\n\nmkdir \/mnt\/wordpress -p\ncd    \/mnt\/wordpress\n\nwget https:\/\/wordpress.org\/latest.tar.gz\ntar xf  latest.tar.gz\nchown -R www-data:www-data wordpress\nmv  wordpress www\n\n#  \u5bb9\u5668 linuxserver\/nginx \u5b89\u88c5\uff0c\u5df2\u7ecf\u5305\u542bphp7.x\u652f\u6301\n\ndocker run -d \\r\n  --name=nginx \\r\n  -e PUID=1000 \\r\n  -e PGID=1000 \\r\n  -e TZ=Europe\/London \\r\n  -p 80:80 \\r\n  -p 443:443 \\r\n  -v \/mnt\/wordpress:\/config \\r\n  --restart unless-stopped \\r\n  linuxserver\/nginx\n\n# \u5bb9\u5668 linuxserver\/mariadb  \u6570\u636e\u5e93\u7a0b\u5e8f\u5b89\u88c5\n\ndocker run -d \\r\n  --name=mysql \\r\n  -e PUID=1000 \\r\n  -e PGID=1000 \\r\n  -e MYSQL_ROOT_PASSWORD=\u5bc6\u7801  \\r\n  -e TZ=Europe\/London \\r\n  -e MYSQL_DATABASE=wordpress    \\r\n  -e MYSQL_USER=wordpress     \\r\n  -e MYSQL_PASSWORD=\u5bc6\u7801  \\r\n  -p 3306:3306 \\r\n  -v \/mnt\/wordpress:\/config \\r\n  --restart unless-stopped \\r\n  linuxserver\/mariadb\n<\/code><\/pre>\n<h3>WordPress \u535a\u5ba2\u7a0b\u5e8f \u914d\u7f6e<\/h3>\n<ul>\n<li><a href=\"http:\/\/wp.lyvba.com\/wp-admin\/setup-config.php\">http:\/\/wp.lyvba.com\/wp-admin\/setup-config.php<\/a><\/li>\n<\/ul>\n<pre><code>\u6570\u636e\u5e93\u8fde\u63a5 \u914d\u7f6e\n\n\u6570\u636e\u5e93\u540d    wordpress\n\u7528\u6237\u540d    wordpress\n\u5bc6\u7801    \u5bc6\u7801\n\u6570\u636e\u5e93\u4e3b\u673a    localhost ( mysql\u5bb9\u5668IP 172.17.0.4 \u6216\u8005\u7f51\u5173 172.17.0.1  )\n            \u6709\u4e9b\u6a21\u7248 \u586b \u5bb9\u5668\u540d\u79f0 mysql \u4e5f\u53ef\u4ee5\n<\/code><\/pre>\n<hr \/>\n<h3>Typecho \u7b80\u5355\u535a\u5ba2\u6846\u67b6 Docker \u5b89\u88c5\u7b14\u8bb0<\/h3>\n<pre><code># Typecho \u7b80\u5355\u535a\u5ba2 \u7a0b\u5e8f\u4e0b\u8f7d\u548c\u76ee\u5f55\u653e\u7f6e\n\nmkdir \/mnt\/typecho -p\ncd    \/mnt\/typecho\n\nwget https:\/\/typecho.org\/downloads\/1.1-17.10.30-release.tar.gz\ntar xf 1.1-17.10.30-release.tar.gz\nmv  build www\n\n# \u5bb9\u5668 linuxserver\/nginx \u5b89\u88c5\uff0c\u5df2\u7ecf\u5305\u542bphp7.x\u652f\u6301\n\ndocker run -d \\r\n  --name=nginx \\r\n  -e PUID=1000 \\r\n  -e PGID=1000 \\r\n  -e TZ=Europe\/London \\r\n  -p 80:80 \\r\n  -p 443:443 \\r\n  -v \/mnt\/typecho:\/config \\r\n  --restart unless-stopped \\r\n  linuxserver\/nginx\n\n# \u5b89\u88c5\u6309\u63d0\u793a\uff0c\u6570\u636e\u5e93 \u5148 Sqlite 3.0\n\nNginx\u670d\u52a1\u5668\u65e0\u6cd5\u767b\u5f55\u540e\u53f0\uff0c\u70b9\u51fb\u524d\u53f0\u94fe\u63a5\u6216\u8005\u540e\u53f0\u767b\u5f55\u65f6\u51fa\u73b0\"404, not found\"\n=============================================================\n\nhttp:\/\/docs.typecho.org\/faq\n\n\u4e00\u822c\u7684\u51fa\u73b0\u8fd9\u79cd\u60c5\u51b5\u65f6,nginx.conf\u91cc\u7684\u7684location\u8bbe\u7f6e\u90fd\u662f\u7c7b\u4f3c\u8fd9\u6837\n\nlocation ~ .*.php$\n\n\u8981\u652f\u6301pathinfo\uff0c\u8981\u6539\u6210\n\nlocation ~ .*.php(\/.*)*$<\/code><\/pre>\n<h2><img decoding=\"async\" src=\"https:\/\/lyvba.com\/wp-content\/uploads\/2021\/03\/2808315419.png\" alt=\"qb.png\" title=\"qb.png\"><\/h2>\n<h2>Docker \u5b89\u88c5PT\u4e0b\u8f7d\u795e\u5668 QB \u548c TR<\/h2>\n<pre><code># \u811a\u672c\u5b89\u88c5\nwget git.io\/wgmtu\n\n# \u5b89\u88c5Docker\u8f6f\u4ef6\nbash wgmtu docker\n\n# \u5b89\u88c5qbittorrent\u8f6f\u4ef6\nbash wgmtu qb\n\n# \u5b89\u88c5transmission\u8f6f\u4ef6(\u76ee\u524d\u975edocker\u5b89\u88c5)\n# docker \u5b89\u88c5\u53c2\u8003\u4e0b\u9762\u547d\u4ee4\nbash wgmtu tr<\/code><\/pre>\n<h3>\u5b89\u88c5Docker\u8f6f\u4ef6<\/h3>\n<p>curl -fsSLo- get.docker.com | \/bin\/sh<\/p>\n<h3>\u6d4b\u8bd5\u8fd0\u884c<\/h3>\n<p>docker run hello-world<\/p>\n<h3>\u521b\u5efa\u5bb9\u5668: qbittorrent<\/h3>\n<pre><code class=\"lang-bash\">docker run --name=qbittorrent \\r\n-e PUID=1000 -e PGID=1000 \\r\n-e TZ=Asia\/ShangHai \\r\n-e UMASK_SET=022 -e \\r\nWEBUI_PORT=8080 \\r\n-p 59902:59902 \\r\n-p 59902:59902\/udp \\r\n-p 8080:8080 \\r\n-v \/mnt\/config:\/config \\r\n-v \/mnt\/downloads:\/downloads \\r\n--restart unless-stopped \\r\n-d linuxserver\/qbittorrent<\/code><\/pre>\n<h3>\u521b\u5efa\u5bb9\u5668: transmission<\/h3>\n<pre><code class=\"lang-bash\">docker run --name=transmission \\r\n-e PUID=1000 -e PGID=1000 \\r\n-e TZ=Asia\/ShangHai \\r\n-e TRANSMISSION_WEB_HOME=\/transmission-web-control\/  \\r\n-e USER=admin   -e PASS=password@2021 \\r\n-p 9091:9091 \\r\n-p 51413:51413 \\r\n-p 51413:51413\/udp \\r\n-v \/mnt\/config:\/config \\r\n-v \/mnt\/downloads:\/downloads \\r\n-v \/mnt\/watch:\/watch \\r\n--restart unless-stopped \\r\n-d linuxserver\/transmission<\/code><\/pre>\n<h3>\u767b\u9646<\/h3>\n<ul>\n<li>\u7528\u9ed8\u8ba4\u7528\u6237\u540d\u5bc6\u7801(admin\/adminadmin)\u767b\u5f55,\u7aef\u53e38080,\u914d\u7f6ePeer\u7aef\u53e3(\u7528\u4e8e\u4f20\u5165\u94fe\u63a5\u7684\u7aef\u53e3)59902,\u914d\u7f6e\u5b8c\u57fa\u672c\u7684\u4e1c\u897f\u4e4b\u540e\u91cd\u542fQB.<br \/>docker restart qbittorrent<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Docker \u642d\u5efaPortainer\u53ef\u89c6\u5316\u754c\u9762 Portainer\u662fDocker\u7684\u56fe\u5f62\u5316\u7ba1\u7406\u5de5\u5177\uff0c\u63d0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[15,35,41,30],"class_list":["post-11","post","type-post","status-publish","format-standard","hentry","category-docker","category-default","tag-docker","tag-nginx","tag-portainer","tag-web"],"_links":{"self":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/11","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/comments?post=11"}],"version-history":[{"count":0,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/posts\/11\/revisions"}],"wp:attachment":[{"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/media?parent=11"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/categories?post=11"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lyvba.com\/index.php\/wp-json\/wp\/v2\/tags?post=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}