mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-16 15:10:12 +01:00
Deployed 9b998fb with MkDocs version: 1.1.2
This commit is contained in:
parent
53c402703e
commit
1731302145
36 changed files with 978 additions and 899 deletions
|
|
@ -7,11 +7,12 @@
|
|||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
|
||||
|
||||
|
||||
<link rel="canonical" href="http://containrrr.github.io/watchtower/usage-overview/">
|
||||
|
||||
|
||||
<link rel="shortcut icon" href="../assets/images/favicon.png">
|
||||
<meta name="generator" content="mkdocs-1.1.2, mkdocs-material-6.0.1">
|
||||
<link rel="shortcut icon" href="../images/favicon.ico">
|
||||
<meta name="generator" content="mkdocs-1.1.2, mkdocs-material-6.1.7">
|
||||
|
||||
|
||||
|
||||
|
|
@ -19,10 +20,10 @@
|
|||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../assets/stylesheets/main.38780c08.min.css">
|
||||
<link rel="stylesheet" href="../assets/stylesheets/main.19753c6b.min.css">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../assets/stylesheets/palette.3f72e892.min.css">
|
||||
<link rel="stylesheet" href="../assets/stylesheets/palette.196e0c26.min.css">
|
||||
|
||||
|
||||
|
||||
|
|
@ -37,6 +38,8 @@
|
|||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="../stylesheets/theme.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -49,7 +52,7 @@
|
|||
|
||||
|
||||
|
||||
<body dir="ltr" data-md-color-scheme="" data-md-color-primary="none" data-md-color-accent="none">
|
||||
<body dir="ltr" data-md-color-scheme="containrrr" data-md-color-primary="" data-md-color-accent="">
|
||||
|
||||
|
||||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||||
|
|
@ -62,12 +65,13 @@
|
|||
|
||||
</div>
|
||||
|
||||
<header class="md-header" data-md-component="header">
|
||||
|
||||
|
||||
<header class="md-header" data-md-component="header">
|
||||
<nav class="md-header-nav md-grid" aria-label="Header">
|
||||
<a href="http://containrrr.github.io/watchtower/" title="Watchtower" class="md-header-nav__button md-logo" aria-label="Watchtower">
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 003-3 3 3 0 00-3-3 3 3 0 00-3 3 3 3 0 003 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54z"/></svg>
|
||||
<img src="../images/logo-450px.png" alt="logo">
|
||||
|
||||
</a>
|
||||
<label class="md-header-nav__button md-icon" for="__drawer">
|
||||
|
|
@ -96,7 +100,7 @@
|
|||
<label class="md-search__overlay" for="__search"></label>
|
||||
<div class="md-search__inner" role="search">
|
||||
<form class="md-search__form" name="search">
|
||||
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active">
|
||||
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active" required>
|
||||
<label class="md-search__icon md-icon" for="__search">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
|
||||
|
|
@ -147,12 +151,13 @@
|
|||
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||||
<div class="md-sidebar__scrollwrap">
|
||||
<div class="md-sidebar__inner">
|
||||
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
|
||||
|
||||
|
||||
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
|
||||
<label class="md-nav__title" for="__drawer">
|
||||
<a href="http://containrrr.github.io/watchtower/" title="Watchtower" class="md-nav__button md-logo" aria-label="Watchtower">
|
||||
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 003-3 3 3 0 00-3-3 3 3 0 00-3 3 3 3 0 003 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54z"/></svg>
|
||||
<img src="../images/logo-450px.png" alt="logo">
|
||||
|
||||
</a>
|
||||
Watchtower
|
||||
|
|
@ -179,7 +184,7 @@
|
|||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href=".." title="Home" class="md-nav__link">
|
||||
<a href=".." class="md-nav__link">
|
||||
Home
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -191,7 +196,7 @@
|
|||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../introduction/" title="Introduction" class="md-nav__link">
|
||||
<a href="../introduction/" class="md-nav__link">
|
||||
Introduction
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -209,7 +214,7 @@
|
|||
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||||
|
||||
|
||||
<a href="./" title="Usage overview" class="md-nav__link md-nav__link--active">
|
||||
<a href="./" class="md-nav__link md-nav__link--active">
|
||||
Usage overview
|
||||
</a>
|
||||
|
||||
|
|
@ -222,7 +227,7 @@
|
|||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../arguments/" title="Arguments" class="md-nav__link">
|
||||
<a href="../arguments/" class="md-nav__link">
|
||||
Arguments
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -234,7 +239,7 @@
|
|||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../notifications/" title="Notifications" class="md-nav__link">
|
||||
<a href="../notifications/" class="md-nav__link">
|
||||
Notifications
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -246,7 +251,7 @@
|
|||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../container-selection/" title="Container selection" class="md-nav__link">
|
||||
<a href="../container-selection/" class="md-nav__link">
|
||||
Container selection
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -258,7 +263,7 @@
|
|||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../private-registries/" title="Private registries" class="md-nav__link">
|
||||
<a href="../private-registries/" class="md-nav__link">
|
||||
Private registries
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -270,7 +275,7 @@
|
|||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../linked-containers/" title="Linked containers" class="md-nav__link">
|
||||
<a href="../linked-containers/" class="md-nav__link">
|
||||
Linked containers
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -282,7 +287,7 @@
|
|||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../remote-hosts/" title="Remote hosts" class="md-nav__link">
|
||||
<a href="../remote-hosts/" class="md-nav__link">
|
||||
Remote hosts
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -294,7 +299,7 @@
|
|||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../secure-connections/" title="Secure connections" class="md-nav__link">
|
||||
<a href="../secure-connections/" class="md-nav__link">
|
||||
Secure connections
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -306,7 +311,7 @@
|
|||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../stop-signals/" title="Stop signals" class="md-nav__link">
|
||||
<a href="../stop-signals/" class="md-nav__link">
|
||||
Stop signals
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -318,7 +323,7 @@
|
|||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../lifecycle-hooks/" title="Lifecycle hooks" class="md-nav__link">
|
||||
<a href="../lifecycle-hooks/" class="md-nav__link">
|
||||
Lifecycle hooks
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -330,7 +335,7 @@
|
|||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../running-multiple-instances/" title="Running multiple instances" class="md-nav__link">
|
||||
<a href="../running-multiple-instances/" class="md-nav__link">
|
||||
Running multiple instances
|
||||
</a>
|
||||
</li>
|
||||
|
|
@ -358,50 +363,50 @@
|
|||
<p>Watchtower is itself packaged as a Docker container so installation is as simple as pulling the <code>containrrr/watchtower</code> image. If you are using ARM based architecture, pull the appropriate <code>containrrr/watchtower:armhf-<tag></code> image from the <a href="https://hub.docker.com/r/containrrr/watchtower/tags/">containrrr Docker Hub</a>.</p>
|
||||
<p>Since the watchtower code needs to interact with the Docker API in order to monitor the running containers, you need to mount <em>/var/run/docker.sock</em> into the container with the <code>-v</code> flag when you run it.</p>
|
||||
<p>Run the <code>watchtower</code> container with the following command:</p>
|
||||
<pre><code class="bash">docker run -d \
|
||||
--name watchtower \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
<div class="codehilite"><pre><span></span><code>docker run -d <span class="se">\</span>
|
||||
--name watchtower <span class="se">\</span>
|
||||
-v /var/run/docker.sock:/var/run/docker.sock <span class="se">\</span>
|
||||
containrrr/watchtower
|
||||
</code></pre>
|
||||
</code></pre></div>
|
||||
|
||||
<p>If pulling images from private Docker registries, supply registry authentication credentials with the environment variables <code>REPO_USER</code> and <code>REPO_PASS</code>
|
||||
or by mounting the host's docker config file into the container (at the root of the container filesystem <code>/</code>).</p>
|
||||
<p>Passing environment variables:</p>
|
||||
<pre><code class="bash">docker run -d \
|
||||
--name watchtower \
|
||||
-e REPO_USER=username \
|
||||
-e REPO_PASS=password \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
<div class="codehilite"><pre><span></span><code>docker run -d <span class="se">\</span>
|
||||
--name watchtower <span class="se">\</span>
|
||||
-e <span class="nv">REPO_USER</span><span class="o">=</span>username <span class="se">\</span>
|
||||
-e <span class="nv">REPO_PASS</span><span class="o">=</span>password <span class="se">\</span>
|
||||
-v /var/run/docker.sock:/var/run/docker.sock <span class="se">\</span>
|
||||
containrrr/watchtower container_to_watch --debug
|
||||
</code></pre>
|
||||
</code></pre></div>
|
||||
|
||||
<p>Also check out <a href="https://stackoverflow.com/a/30494145/7872793">this Stack Overflow answer</a> for more options on how to pass environment variables.</p>
|
||||
<p>Mounting the host's docker config file:</p>
|
||||
<pre><code class="bash">docker run -d \
|
||||
--name watchtower \
|
||||
-v /home/<user>/.docker/config.json:/config.json \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
<div class="codehilite"><pre><span></span><code>docker run -d <span class="se">\</span>
|
||||
--name watchtower <span class="se">\</span>
|
||||
-v /home/<user>/.docker/config.json:/config.json <span class="se">\</span>
|
||||
-v /var/run/docker.sock:/var/run/docker.sock <span class="se">\</span>
|
||||
containrrr/watchtower container_to_watch --debug
|
||||
</code></pre>
|
||||
</code></pre></div>
|
||||
|
||||
<blockquote>
|
||||
<p>NOTE: if you mount <code>config.json</code> in the manner above, changes from the host system will (generally) not be propagated to the running container. Mounting files into the Docker daemon uses bind mounts, which are based on inodes. Most applications (including <code>docker login</code> and <code>vim</code>) will not directly edit the file, but instead make a copy and replace the original file, which results in a new inode which in turn <em>breaks</em> the bind mount. <strong>As a workaround</strong>, you can create a symlink to your <code>config.json</code> file and then mount the symlink in the container. The symlinked file will always have the same inode, which keeps the bind mount intact and will ensure changes to the original file are propagated to the running container (regardless of the inode of the source file!).</p>
|
||||
</blockquote>
|
||||
<p>If you mount the config file as described above, be sure to also prepend the URL for the registry when starting up your watched image (you can omit the https://). Here is a complete docker-compose.yml file that starts up a docker container from a private repo at Docker Hub and monitors it with watchtower. Note the command argument changing the interval to 30s rather than the default 5 minutes.</p>
|
||||
<pre><code class="json">version: "3"
|
||||
services:
|
||||
cavo:
|
||||
image: index.docker.io/<org>/<image>:<tag>
|
||||
ports:
|
||||
- "443:3443"
|
||||
- "80:3080"
|
||||
watchtower:
|
||||
image: containrrr/watchtower
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- /root/.docker/config.json:/config.json
|
||||
command: --interval 30
|
||||
</code></pre>
|
||||
<div class="codehilite"><pre><span></span><code><span class="nt">version</span><span class="p">:</span> <span class="s">"3"</span>
|
||||
<span class="nt">services</span><span class="p">:</span>
|
||||
<span class="nt">cavo</span><span class="p">:</span>
|
||||
<span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">index.docker.io/<org>/<image>:<tag></span>
|
||||
<span class="nt">ports</span><span class="p">:</span>
|
||||
<span class="p p-Indicator">-</span> <span class="s">"443:3443"</span>
|
||||
<span class="p p-Indicator">-</span> <span class="s">"80:3080"</span>
|
||||
<span class="nt">watchtower</span><span class="p">:</span>
|
||||
<span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">containrrr/watchtower</span>
|
||||
<span class="nt">volumes</span><span class="p">:</span>
|
||||
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/var/run/docker.sock:/var/run/docker.sock</span>
|
||||
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/root/.docker/config.json:/config.json</span>
|
||||
<span class="nt">command</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">--interval 30</span>
|
||||
</code></pre></div>
|
||||
|
||||
|
||||
|
||||
|
|
@ -420,7 +425,7 @@ services:
|
|||
<div class="md-footer-nav">
|
||||
<nav class="md-footer-nav__inner md-grid" aria-label="Footer">
|
||||
|
||||
<a href="../introduction/" title="Introduction" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
||||
<a href="../introduction/" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
||||
<div class="md-footer-nav__button md-icon">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
|
||||
</div>
|
||||
|
|
@ -435,7 +440,7 @@ services:
|
|||
</a>
|
||||
|
||||
|
||||
<a href="../arguments/" title="Arguments" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
|
||||
<a href="../arguments/" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
|
||||
<div class="md-footer-nav__title">
|
||||
<div class="md-ellipsis">
|
||||
<span class="md-footer-nav__direction">
|
||||
|
|
@ -468,8 +473,8 @@ services:
|
|||
|
||||
</div>
|
||||
|
||||
<script src="../assets/javascripts/vendor.77e55a48.min.js"></script>
|
||||
<script src="../assets/javascripts/bundle.aa3f9871.min.js"></script><script id="__lang" type="application/json">{"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing"}</script>
|
||||
<script src="../assets/javascripts/vendor.0ac82a11.min.js"></script>
|
||||
<script src="../assets/javascripts/bundle.f81dfb4d.min.js"></script><script id="__lang" type="application/json">{"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing"}</script>
|
||||
|
||||
<script>
|
||||
app = initialize({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue