{"id":872,"date":"2020-10-09T18:18:03","date_gmt":"2020-10-09T10:18:03","guid":{"rendered":"https:\/\/aichh.com\/?p=872"},"modified":"2020-10-31T08:14:36","modified_gmt":"2020-10-31T00:14:36","slug":"watchtower-%e8%87%aa%e5%8a%a8%e6%9b%b4%e6%96%b0-docker-%e9%95%9c%e5%83%8f%e4%b8%8e%e5%ae%b9%e5%99%a8","status":"publish","type":"post","link":"https:\/\/aichh.com\/872.html","title":{"rendered":"Watchtower &#8211; \u81ea\u52a8\u66f4\u65b0 Docker \u955c\u50cf\u4e0e\u5bb9\u5668"},"content":{"rendered":"<!--wp-compress-html--><!--wp-compress-html no compression--><h2 id=\"toc_0\">\u524d\u8a00<\/h2>\n<p>Docker \u5bb9\u5668\u7684\u90e8\u7f72\u6709\u4e00\u79cd\u5728\u624b\u673a\u4e0a\u88c5 App \u7684\u611f\u89c9\uff0c\u4f46 Docker \u5bb9\u5668\u5e76\u4e0d\u4f1a\u50cf\u624b\u673a App \u90a3\u6837\u4f1a\u81ea\u52a8\u66f4\u65b0\uff0c\u800c\u5982\u679c\u6211\u4eec\u9700\u8981\u66f4\u65b0\u5bb9\u5668\u4e00\u822c\u9700\u8981\u4ee5\u4e0b\u56db\u4e2a\u6b65\u9aa4\uff1a<\/p>\n<pre>\u505c\u6b62\u5bb9\u5668\uff1adocker stop\r\n\u5220\u9664\u5bb9\u5668\uff1adocker rm\r\n\u66f4\u65b0\u955c\u50cf\uff1adocker pull\r\n\u542f\u52a8\u5bb9\u5668\uff1adocker run\r\n<\/pre>\n<p>\u505c\u6b62\u5bb9\u5668\u8fd9\u4e2a\u6b65\u9aa4\u53ef\u4ee5\u5728\u5220\u9664\u5bb9\u5668\u65f6\u4f7f\u7528\u00a0<code>-f<\/code>\u00a0\u53c2\u6570\u6765\u4ee3\u66ff\uff0c\u5373\u4f7f\u8fd9\u6837\u8fd8\u662f\u9700\u8981\u4e09\u4e2a\u6b65\u9aa4\u3002\u5982\u679c\u90e8\u7f72\u4e86\u5927\u91cf\u7684\u5bb9\u5668\u9700\u8981\u66f4\u65b0\u4f7f\u7528\u8fd9\u79cd\u4f20\u7edf\u7684\u65b9\u5f0f\u5de5\u4f5c\u91cf\u662f\u5de8\u5927\u7684\u3002<\/p>\n<p><a href=\"https:\/\/p3terx.com\/go\/aHR0cHM6Ly9naXRodWIuY29tL2NvbnRhaW5ycnIvd2F0Y2h0b3dlcg==\" target=\"_blank\" rel=\"noopener noreferrer\">Watchtower<\/a>\u00a0\u662f\u4e00\u4e2a\u53ef\u4ee5\u5b9e\u73b0\u81ea\u52a8\u5316\u66f4\u65b0 Docker \u57fa\u7840\u955c\u50cf\u4e0e\u5bb9\u5668\u7684\u5b9e\u7528\u5de5\u5177\u3002\u5b83\u76d1\u89c6\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668\u4ee5\u53ca\u76f8\u5173\u7684\u955c\u50cf\uff0c\u5f53\u68c0\u6d4b\u5230 reg\u00adistry \u4e2d\u7684\u955c\u50cf\u4e0e\u672c\u5730\u7684\u955c\u50cf\u6709\u5dee\u5f02\u65f6\uff0c\u5b83\u4f1a\u62c9\u53d6\u6700\u65b0\u955c\u50cf\u5e76\u4f7f\u7528\u6700\u521d\u90e8\u7f72\u65f6\u76f8\u540c\u7684\u53c2\u6570\u91cd\u65b0\u542f\u52a8\u76f8\u5e94\u7684\u5bb9\u5668\uff0c\u4e00\u5207\u597d\u50cf\u4ec0\u4e48\u90fd\u6ca1\u53d1\u751f\u8fc7\uff0c\u5c31\u50cf\u66f4\u65b0\u624b\u673a\u4e0a\u7684 App \u4e00\u6837\u3002<\/p>\n<h2 id=\"toc_1\">\u5feb\u901f\u5f00\u59cb<\/h2>\n<p>Watch\u00adtower \u672c\u8eab\u88ab\u6253\u5305\u4e3a Docker \u955c\u50cf\uff0c\u56e0\u6b64\u53ef\u4ee5\u50cf\u8fd0\u884c\u4efb\u4f55\u5176\u4ed6\u5bb9\u5668\u4e00\u6837\u8fd0\u884c\u5b83\uff1a<\/p>\n<pre>docker run -d\r\n    --name watchtower  \r\n    -v \/var\/run\/docker.sock:\/var\/run\/docker.sock  \r\n    containrrr\/watchtower<\/pre>\n<p>\u7136\u540e\u6240\u6709\u5bb9\u5668\u90fd\u4f1a\u81ea\u52a8\u66f4\u65b0\uff0c\u4e5f\u5305\u62ec Watch\u00adtower \u672c\u8eab\u3002<\/p>\n<h2 id=\"toc_2\">\u9009\u9879\u53c2\u6570<\/h2>\n<p>&nbsp;<\/p>\n<details>\n<summary>\u70b9\u51fb\u67e5\u770b<\/summary>\n<p>&nbsp;<\/p>\n<pre class=\" language-none line-numbers\"><code class=\" language-none\">$ docker run --rm containrrr\/watchtower -h\r\n\r\nWatchtower automatically updates running Docker containers whenever a new image is released.\r\nMore information available at https:\/\/github.com\/containrrr\/watchtower\/.\r\n\r\nUsage:\r\n  watchtower [flags]\r\n\r\nFlags:\r\n  -a, --api-version string                          api version to use by docker client (default \"1.24\")\r\n  -c, --cleanup                                     remove previously used images after updating\r\n  -d, --debug                                       enable debug mode with verbose logging\r\n      --enable-lifecycle-hooks                      Enable the execution of commands triggered by pre- and post-update lifecycle hooks\r\n  -h, --help                                        help for watchtower\r\n  -H, --host string                                 daemon socket to connect to (default \"unix:\/\/\/var\/run\/docker.sock\")\r\n  -S, --include-stopped                             Will also include created and exited containers\r\n  -i, --interval int                                poll interval (in seconds) (default 300)\r\n  -e, --label-enable                                watch containers where the com.centurylinklabs.watchtower.enable label is true\r\n  -m, --monitor-only                                Will only monitor for new images, not update the containers\r\n      --no-pull                                     do not pull any new images\r\n      --no-restart                                  do not restart any containers\r\n      --notification-email-delay int                Delay before sending notifications, expressed in seconds\r\n      --notification-email-from string              Address to send notification emails from\r\n      --notification-email-server string            SMTP server to send notification emails through\r\n      --notification-email-server-password string   SMTP server password for sending notifications\r\n      --notification-email-server-port int          SMTP server port to send notification emails through (default 25)\r\n      --notification-email-server-tls-skip-verify\r\n                                                    Controls whether watchtower verifies the SMTP server's certificate chain and host name.\r\n                                                    Should only be used for testing.\r\n\r\n      --notification-email-server-user string       SMTP server user for sending notifications\r\n      --notification-email-subjecttag string        Subject prefix tag for notifications via mail\r\n      --notification-email-to string                Address to send notification emails to\r\n      --notification-gotify-token string            The Gotify Application required to query the Gotify API\r\n      --notification-gotify-url string              The Gotify URL to send notifications to\r\n      --notification-msteams-data                   The MSTeams notifier will try to extract log entry fields as MSTeams message facts\r\n      --notification-msteams-hook string            The MSTeams WebHook URL to send notifications to\r\n      --notification-slack-channel string           A string which overrides the webhook's default channel. Example: #my-custom-channel\r\n      --notification-slack-hook-url string          The Slack Hook URL to send notifications to\r\n      --notification-slack-icon-emoji string        An emoji code string to use in place of the default icon\r\n      --notification-slack-icon-url string          An icon image URL string to use in place of the default icon\r\n      --notification-slack-identifier string        A string which will be used to identify the messages coming from this watchtower instance (default \"watchtower\")\r\n  -n, --notifications strings                        notification types to send (valid: email, slack, msteams, gotify)\r\n      --notifications-level string                  The log level used for sending notifications. Possible values: panic, fatal, error, warn, info or debug (default \"info\")\r\n      --remove-volumes                              remove attached volumes before updating\r\n      --revive-stopped                              Will also start stopped containers that were updated, if include-stopped is active\r\n  -R, --run-once                                    Run once now and exit\r\n  -s, --schedule string                             the cron expression which defines when to update\r\n  -t, --stop-timeout duration                       timeout before a container is forcefully stopped (default 10s)\r\n  -v, --tlsverify                                   use TLS and verify the remote<\/code><\/pre>\n<p>&nbsp;<\/p>\n<\/details>\n<p>&nbsp;<\/p>\n<h2 id=\"toc_3\">\u81ea\u52a8\u6e05\u9664\u65e7\u955c\u50cf<\/h2>\n<p>\u5b98\u65b9\u7ed9\u51fa\u7684\u9ed8\u8ba4\u542f\u52a8\u547d\u4ee4\u5728\u957f\u671f\u4f7f\u7528\u540e\u4f1a\u5806\u79ef\u975e\u5e38\u591a\u7684\u6807\u7b7e\u4e3a\u00a0<code>none<\/code>\u00a0\u7684\u65e7\u955c\u50cf\uff0c\u5982\u679c\u653e\u4efb\u4e0d\u7ba1\u4f1a\u5360\u7528\u5927\u91cf\u7684\u78c1\u76d8\u7a7a\u95f4\u3002\u8981\u907f\u514d\u8fd9\u79cd\u60c5\u51b5\u53ef\u4ee5\u52a0\u5165\u00a0<code>--cleanup<\/code>\u00a0\u9009\u9879\uff0c\u8fd9\u6837\u6bcf\u6b21\u66f4\u65b0\u90fd\u4f1a\u628a\u65e7\u7684\u955c\u50cf\u6e05\u7406\u6389\u3002<\/p>\n<pre>docker run -d  \r\n    --name watchtower  \r\n    --restart unless-stopped  \r\n    -v \/var\/run\/docker.sock:\/var\/run\/docker.sock\r\n    containrrr\/watchtower  \r\n    --cleanup<\/pre>\n<p><code>--cleanup<\/code>\u00a0\u9009\u9879\u53ef\u4ee5\u7b80\u5199\u4e3a\u00a0<code>-c<\/code>\uff1a<\/p>\n<pre>docker run -d  \r\n    --name watchtower  \r\n    --restart unless-stopped  \r\n    -v \/var\/run\/docker.sock:\/var\/run\/docker.sock  \r\n    containrrr\/watchtower -c<\/pre>\n<h2 id=\"toc_4\">\u9009\u62e9\u6027\u81ea\u52a8\u66f4\u65b0<\/h2>\n<p>\u67d0\u4e9b\u5bb9\u5668\u53ef\u80fd\u9700\u8981\u7a33\u5b9a\u7684\u8fd0\u884c\uff0c\u7ecf\u5e38\u66f4\u65b0\u6216\u91cd\u542f\u53ef\u80fd\u4f1a\u9020\u6210\u4e00\u4e9b\u95ee\u9898\uff0c\u8fd9\u65f6\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u9009\u9879\u53c2\u6570\u6765\u9009\u62e9\u4e0e\u63a7\u5236\u5bb9\u5668\u7684\u66f4\u65b0\u3002<\/p>\n<h3 id=\"toc_5\">\u5bb9\u5668\u66f4\u65b0\u5217\u8868<\/h3>\n<p>\u5047\u8bbe\u6211\u4eec\u53ea\u60f3\u66f4\u65b0\u00a0<code>nginx<\/code>\u3001<code>redis<\/code>\u00a0\u8fd9\u4e24\u4e2a\u5bb9\u5668\uff0c\u6211\u4eec\u53ef\u4ee5\u628a\u5bb9\u5668\u540d\u79f0\u8ffd\u52a0\u5230\u542f\u52a8\u547d\u4ee4\u7684\u6700\u540e\u9762\uff0c\u5c31\u50cf\u4e0b\u9762\u8fd9\u4e2a\u4f8b\u5b50\uff1a<\/p>\n<pre>docker run -d  \r\n    --name watchtower \r\n    --restart unless-stopped  \r\n    -v \/var\/run\/docker.sock:\/var\/run\/docker.sock  \r\n    containrrr\/watchtower -c  \r\n    nginx redis<\/pre>\n<p>\u535a\u4e3b\u89c9\u5f97\u628a\u9700\u8981\u66f4\u65b0\u7684\u5bb9\u5668\u540d\u79f0\u5199\u5728\u542f\u52a8\u547d\u4ee4\u4e2d\u4e0d\u5229\u4e8e\u7ba1\u7406\uff0c\u4e8e\u662f\u60f3\u4e86\u4e2a\u66f4\u597d\u7684\u65b9\u6cd5\uff0c\u5efa\u7acb\u4e00\u4e2a\u66f4\u65b0\u5217\u8868\u6587\u4ef6\u3002<\/p>\n<pre class=\" language-none line-numbers\"><code class=\" language-none\">$ cat ~\/.watchtower.list\r\naria2-pro\r\nunlockmusic\r\nmtg\r\n...<\/code><\/pre>\n<p>\u901a\u8fc7\u53d8\u91cf\u7684\u65b9\u5f0f\u53bb\u8c03\u7528\u8fd9\u4e2a\u5217\u8868\uff1a<\/p>\n<pre class=\" language-none line-numbers\"><code class=\" language-none\">docker run -d  \r\n    --name watchtower  \r\n    --restart unless-stopped  \r\n    -v \/var\/run\/docker.sock:\/var\/run\/docker.sock  \r\n    containrrr\/watchtower -c  \r\n    $(cat ~\/.watchtower.list) <\/code><\/pre>\n<p>\u8fd9\u6837\u53ea\u9700\u8981\u8c03\u6574\u5217\u8868\u540e\u5220\u9664 Watch\u00adtower \u5bb9\u5668\u5e76\u91cd\u65b0\u6267\u884c\u4e0a\u9762\u7684\u547d\u4ee4\u91cd\u65b0\u542f\u52a8 Watch\u00adtower \u5373\u53ef\u3002<\/p>\n<h3 id=\"toc_6\">\u8bbe\u7f6e\u5355\u4e2a\u5bb9\u5668\u81ea\u52a8\u66f4\u65b0\u7279\u5f81<\/h3>\n<p>\u7ed9\u5bb9\u5668\u4e2d\u6dfb\u52a0\u00a0<code>com.centurylinklabs.watchtower.enable<\/code>\u00a0\u8fd9\u4e2a LA\u00adBEL \u5e76\u8bbe\u7f6e\u5b83\u7684\u503c\u4e3a\u00a0<code>false<\/code>\uff0c\u6216\u8005\u5728\u542f\u52a8\u547d\u4ee4\u4e2d\u52a0\u5165\u00a0<code>--label com.centurylinklabs.watchtower.enable=false<\/code>\u00a0\u53c2\u6570\u53ef\u4ee5\u6392\u9664\u76f8\u5e94\u7684\u5bb9\u5668\u3002\u4e0b\u9762\u8fd9\u4e2a\u4f8b\u5b50\u662f\u535a\u4e3b\u7684\u00a0<code>openwrt-mini<\/code>\u00a0\u955c\u50cf\u7684\u5bb9\u5668\u542f\u52a8\u547d\u4ee4\uff0cWatch\u00adtower \u5c06\u6c38\u8fdc\u5ffd\u7565\u5b83\u7684\u66f4\u65b0\uff0c\u5373\u4f7f\u5b83\u5305\u542b\u5728\u81ea\u52a8\u66f4\u65b0\u5217\u8868\u4e2d\u3002<\/p>\n<pre class=\" language-none line-numbers\"><code class=\" language-none\">docker run -d  \r\n    --name openwrt-mini  \r\n    --restart always  \r\n    --network openwrt  \r\n    --privileged  \r\n    --label com.centurylinklabs.watchtower.enable=false  \r\n    p3terx\/openwrt-mini  \r\n    \/sbin\/init<\/code><\/pre>\n<p>\u5f53\u5bb9\u5668\u542f\u52a8\u547d\u4ee4\u4e2d\u52a0\u5165\u00a0<code>--label com.centurylinklabs.watchtower.enable=true<\/code>\u00a0\u53c2\u6570\uff0c\u5e76\u4e14\u7ed9 Watch\u00adtower \u52a0\u4e0a\u00a0<code>--label-enable<\/code>\u00a0\u9009\u9879\u65f6\uff0cWatch\u00adtower \u5c06\u53ea\u66f4\u65b0\u8fd9\u4e9b\u5305\u542b\u6b64\u53c2\u6570\u7684\u5bb9\u5668\u3002<\/p>\n<pre class=\" language-none line-numbers\"><code class=\" language-none\">docker run -d  \r\n    --name watchtower  \r\n    --restart unless-stopped  \r\n    -v \/var\/run\/docker.sock:\/var\/run\/docker.sock  \r\n    containrrr\/watchtower -c  \r\n    --label-enable <\/code><\/pre>\n<p><code>--label-enable<\/code>\u00a0\u53ef\u4ee5\u7b80\u5199\u4e3a\u00a0<code>-e<\/code>\uff1a<\/p>\n<pre class=\" language-none line-numbers\"><code class=\" language-none\">docker run -d  \r\n    --name watchtower  \r\n    --restart unless-stopped  \r\n    -v \/var\/run\/docker.sock:\/var\/run\/docker.sock  \r\n    containrrr\/watchtower -ce<\/code><\/pre>\n<p>\u56e0\u4e3a\u9700\u8981\u5728\u5bb9\u5668\u542f\u52a8\u65f6\u8fdb\u884c\u8bbe\u7f6e\uff0c\u4e14\u8bbe\u7f6e\u540e\u5c31\u65e0\u6cd5\u76f4\u63a5\u66f4\u6539\uff0c\u53ea\u80fd\u91cd\u5efa\u5bb9\u5668\uff0c\u6240\u4ee5\u8fd9\u79cd\u65b9\u5f0f\u7684\u7075\u6d3b\u6027\u4e0d\u5982\u66f4\u65b0\u5217\u8868\u6cd5\u3002\u5c24\u5176\u662f\u5728\u8bbe\u7f6e\u00a0<code>com.centurylinklabs.watchtower.enable=false<\/code>\u00a0\u53c2\u6570\u540e\u5bb9\u5668\u5c06\u6c38\u8fdc\u88ab Watch\u00adtower \u5ffd\u7565\uff0c\u4e5f\u5305\u62ec\u540e\u9762\u5c06\u8981\u63d0\u5230\u7684\u624b\u52a8\u66f4\u65b0\u65b9\u5f0f\uff0c\u6240\u4ee5\u4e00\u822c\u4e0d\u63a8\u8350\u8fd9\u6837\u505a\uff0c\u9664\u975e\u4f60\u613f\u610f\u624b\u52a8\u91cd\u5efa\u7684\u539f\u751f\u65b9\u5f0f\u66f4\u65b0\u3002<\/p>\n<h2 id=\"toc_7\">\u8bbe\u7f6e\u81ea\u52a8\u66f4\u65b0\u68c0\u67e5\u9891\u7387<\/h2>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b Watch\u00adtower \u6bcf 5 \u5206\u949f\u4f1a\u8f6e\u8be2\u4e00\u6b21\uff0c\u5982\u679c\u4f60\u89c9\u5f97\u8fd9\u4e2a\u9891\u7387\u592a\u9ad8\u4e86\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u9009\u9879\u6765\u63a7\u5236\u66f4\u65b0\u68c0\u67e5\u7684\u9891\u7387\uff0c\u4f46\u4e8c\u8005\u53ea\u80fd\u9009\u62e9\u5176\u4e00\u3002<\/p>\n<ul>\n<li><code>--interval<\/code>,\u00a0<code>-i<\/code>\u00a0- \u8bbe\u7f6e\u66f4\u65b0\u68c0\u6d4b\u65f6\u95f4\u95f4\u9694\uff0c\u5355\u4f4d\u4e3a\u79d2\u3002\u6bd4\u5982\u6bcf\u9694 1 \u4e2a\u5c0f\u65f6\u68c0\u67e5\u4e00\u6b21\u66f4\u65b0\uff1a<\/li>\n<\/ul>\n<pre class=\" language-none line-numbers\"><code class=\" language-none\">docker run -d  \r\n    --name watchtower  \r\n    --restart unless-stopped  \r\n    -v \/var\/run\/docker.sock:\/var\/run\/docker.sock  \r\n    containrrr\/watchtower -c  \r\n    --interval 3600<\/code><\/pre>\n<ul>\n<li><code>--schedule<\/code>,\u00a0<code>-s<\/code>\u00a0- \u8bbe\u7f6e\u5b9a\u65f6\u68c0\u6d4b\u66f4\u65b0\u65f6\u95f4\u3002\u683c\u5f0f\u4e3a 6 \u5b57\u6bb5 Cron \u8868\u8fbe\u5f0f\uff0c\u800c\u975e\u4f20\u7edf\u7684 5 \u5b57\u6bb5\uff0c\u5373\u7b2c\u4e00\u4f4d\u662f\u79d2\u3002\u6bd4\u5982\u6bcf\u5929\u51cc\u6668 2 \u70b9\u68c0\u67e5\u4e00\u6b21\u66f4\u65b0\uff1a<\/li>\n<\/ul>\n<pre class=\" language-none line-numbers\"><code class=\" language-none\">docker run -d  \r\n    --name watchtower  \r\n    --restart unless-stopped  \r\n    -v \/var\/run\/docker.sock:\/var\/run\/docker.sock  \r\n    containrrr\/watchtower -c  \r\n    --schedule \"0 0 2 * * *\"<\/code><\/pre>\n<h2 id=\"toc_8\">\u624b\u52a8\u66f4\u65b0<\/h2>\n<p>\u524d\u9762\u7684\u4f7f\u7528\u65b9\u5f0f\u90fd\u662f\u8ba9 Watch\u00adtower \u4ee5\u00a0<code>detached<\/code>\uff08\u540e\u53f0\uff09\u6a21\u5f0f\u5728\u8fd0\u884c\u5e76\u81ea\u52a8\u66f4\u65b0\u5bb9\u5668\uff0c\u800c Watch\u00adtower \u4e5f\u652f\u6301\u4ee5\u00a0<code>foreground<\/code>\uff08\u524d\u53f0\uff09\u6a21\u5f0f\u6765\u4f7f\u7528\uff0c\u5373\u8fd0\u884c\u4e00\u6b21\u9000\u51fa\u5e76\u5220\u6389\u5bb9\u5668\uff0c\u6765\u5b9e\u73b0\u624b\u52a8\u66f4\u65b0\u5bb9\u5668\u3002\u8fd9\u5bf9\u4e8e\u5076\u5c14\u66f4\u65b0\u4e00\u6b21\u90a3\u4e9b\u4e0d\u5728\u81ea\u52a8\u66f4\u65b0\u5217\u8868\u4e2d\u7684\u5bb9\u5668\u975e\u5e38\u6709\u7528\u3002<\/p>\n<p>\u5bf9\u4e8e\u00a0<code>foreground<\/code>\u00a0\u6a21\u5f0f\uff0c\u9700\u8981\u52a0\u4e0a\u00a0<code>--run-once<\/code>\u00a0\u8fd9\u4e2a\u4e13\u7528\u7684\u9009\u9879\u3002\u4e0b\u9762\u7684\u4f8b\u5b50 Docker \u4f1a\u8fd0\u884c\u4e00\u6b21 Watch\u00adtower \u5e76\u68c0\u67e5\u00a0<code>aria2-pro<\/code>\u00a0\u5bb9\u5668\u7684\u57fa\u7840\u955c\u50cf\u66f4\u65b0\uff0c\u6700\u540e\u5220\u6389\u672c\u6b21\u8fd0\u884c\u521b\u5efa\u7684 Watch\u00adtower \u5bb9\u5668\u3002<\/p>\n<pre class=\" language-none line-numbers\"><code class=\" language-none\">docker run --rm  \r\n    -v \/var\/run\/docker.sock:\/var\/run\/docker.sock  \r\n    containrrr\/watchtower -c  \r\n    --run-once  \r\n    aria2-pro<\/code><\/pre>\n<p><code>--run-once<\/code>\u00a0\u53ef\u4ee5\u7b80\u5199\u4e3a\u00a0<code>-R<\/code>\uff1a<\/p>\n<pre class=\" language-none line-numbers\"><code class=\" language-none\">docker run --rm  \r\n    -v \/var\/run\/docker.sock:\/var\/run\/docker.sock  \r\n    containrrr\/watchtower -cR  \r\n    aria2-pro<\/code><\/pre>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f\u5f53\u8fd9\u4e2a\u5bb9\u5668\u8bbe\u7f6e\u8fc7\u00a0<code>com.centurylinklabs.watchtower.enable=false<\/code>\u00a0\u53c2\u6570\u65f6\u4e0d\u4f1a\u66f4\u65b0\u3002<\/p>\n<h2 id=\"toc_9\">\u5c3e\u5df4<\/h2>\n<p>\u4ee5\u4e0a\u662f\u535a\u4e3b\u5728\u4f7f\u7528 Watch\u00adtower \u4e2d\u603b\u7ed3\u7684\u4e00\u4e9b\u4f7f\u7528\u65b9\u5f0f\u548c\u65b9\u6cd5\uff0c\u5f53\u7136\u5b83\u8fd8\u6709\u4e00\u4e9b\u5176\u5b83\u7684\u529f\u80fd\u4e0e\u4f7f\u7528\u65b9\u5f0f\uff0c\u6bd4\u5982\u7535\u5b50\u90ae\u4ef6\u901a\u77e5\u3001\u76d1\u89c6\u79c1\u4eba\u6ce8\u518c\u8868\u7684\u955c\u50cf\u3001\u66f4\u65b0\u8fdc\u7a0b\u4e3b\u673a\u4e0a\u7684\u5bb9\u5668\u7b49\uff0c\u8fd9\u4e9b\u5bf9\u4e8e\u4e00\u822c\u7528\u6237\u6765\u8bf4\u53ef\u80fd\u5f88\u5c11\u4f1a\u7528\u5230\uff0c\u6240\u4ee5\u8fd9\u91cc\u5c31\u4e0d\u8d58\u8ff0\u4e86\uff0c\u611f\u5174\u8da3\u7684\u5c0f\u4f19\u4f34\u53ef\u4ee5\u53bb\u7814\u7a76\u00a0<a href=\"https:\/\/p3terx.com\/go\/aHR0cHM6Ly9jb250YWlucnJyLmdpdGh1Yi5pby93YXRjaHRvd2VyLw==\" target=\"_blank\" rel=\"noopener noreferrer\">Watchtower \u5b98\u65b9\u6587\u6863<\/a>\u3002<\/p>\n<p>&nbsp;<\/p>\n<p class=\"content-copyright\"><strong>\u672c\u6587\u4f5c\u8005\uff1a<\/strong><a href=\"https:\/\/p3terx.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">P3TERX<\/a><\/p>\n<p class=\"content-copyright\"><strong>\u672c\u6587\u94fe\u63a5\uff1a<\/strong><a class=\"content-copyright\" href=\"https:\/\/p3terx.com\/archives\/docker-watchtower.html\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/p3terx.com\/archives\/docker-watchtower.html<\/a><\/p>\n<p>&nbsp;<\/p>\n<!--wp-compress-html no compression--><!--wp-compress-html-->","protected":false},"excerpt":{"rendered":"\u524d\u8a00 Docker \u5bb9\u5668\u7684\u90e8\u7f72\u6709\u4e00\u79cd\u5728\u624b\u673a\u4e0a\u88c5 App \u7684\u611f\u89c9\uff0c\u4f46 Docker \u5bb9\u5668\u5e76\u4e0d\u4f1a\u50cf\u624b\u673a App \u90a3\u6837\u4f1a\u81ea\u52a8\u66f4\u65b0\uff0c\u800c\u5982\u679c\u6211\u4eec\u9700\u8981\u66f4\u65b0\u5bb9\u5668\u4e00\u822c\u9700\u8981\u4ee5\u4e0b\u56db\u4e2a\u6b65\u9aa4\uff1a \u505c\u6b62\u5bb9\u5668\uff1adocker sto \u00b7\u00b7\u00b7","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[64],"class_list":["post-872","post","type-post","status-publish","format-standard","hentry","category-jiaocheng","tag-docker"],"views":349,"_links":{"self":[{"href":"https:\/\/aichh.com\/api\/wp\/v2\/posts\/872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aichh.com\/api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aichh.com\/api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aichh.com\/api\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aichh.com\/api\/wp\/v2\/comments?post=872"}],"version-history":[{"count":7,"href":"https:\/\/aichh.com\/api\/wp\/v2\/posts\/872\/revisions"}],"predecessor-version":[{"id":922,"href":"https:\/\/aichh.com\/api\/wp\/v2\/posts\/872\/revisions\/922"}],"wp:attachment":[{"href":"https:\/\/aichh.com\/api\/wp\/v2\/media?parent=872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aichh.com\/api\/wp\/v2\/categories?post=872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aichh.com\/api\/wp\/v2\/tags?post=872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}