Deployed 9b998fb with MkDocs version: 1.1.2

pull/763/head
3 years ago
parent 53c402703e
commit 1731302145

@ -8,8 +8,9 @@
<link rel="shortcut icon" href="/watchtower/assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.1.2, mkdocs-material-6.0.1">
<link rel="shortcut icon" href="/watchtower/images/favicon.ico">
<meta name="generator" content="mkdocs-1.1.2, mkdocs-material-6.1.7">
@ -17,10 +18,10 @@
<link rel="stylesheet" href="/watchtower/assets/stylesheets/main.38780c08.min.css">
<link rel="stylesheet" href="/watchtower/assets/stylesheets/main.19753c6b.min.css">
<link rel="stylesheet" href="/watchtower/assets/stylesheets/palette.3f72e892.min.css">
<link rel="stylesheet" href="/watchtower/assets/stylesheets/palette.196e0c26.min.css">
@ -35,6 +36,8 @@
<link rel="stylesheet" href="/watchtower/stylesheets/theme.css">
@ -47,7 +50,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">
@ -60,12 +63,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="/watchtower/images/logo-450px.png" alt="logo">
</a>
<label class="md-header-nav__button md-icon" for="__drawer">
@ -94,7 +98,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>
@ -145,12 +149,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="/watchtower/images/logo-450px.png" alt="logo">
</a>
Watchtower
@ -177,7 +182,7 @@
<li class="md-nav__item">
<a href="/watchtower/." title="Home" class="md-nav__link">
<a href="/watchtower/." class="md-nav__link">
Home
</a>
</li>
@ -189,7 +194,7 @@
<li class="md-nav__item">
<a href="/watchtower/introduction/" title="Introduction" class="md-nav__link">
<a href="/watchtower/introduction/" class="md-nav__link">
Introduction
</a>
</li>
@ -201,7 +206,7 @@
<li class="md-nav__item">
<a href="/watchtower/usage-overview/" title="Usage overview" class="md-nav__link">
<a href="/watchtower/usage-overview/" class="md-nav__link">
Usage overview
</a>
</li>
@ -213,7 +218,7 @@
<li class="md-nav__item">
<a href="/watchtower/arguments/" title="Arguments" class="md-nav__link">
<a href="/watchtower/arguments/" class="md-nav__link">
Arguments
</a>
</li>
@ -225,7 +230,7 @@
<li class="md-nav__item">
<a href="/watchtower/notifications/" title="Notifications" class="md-nav__link">
<a href="/watchtower/notifications/" class="md-nav__link">
Notifications
</a>
</li>
@ -237,7 +242,7 @@
<li class="md-nav__item">
<a href="/watchtower/container-selection/" title="Container selection" class="md-nav__link">
<a href="/watchtower/container-selection/" class="md-nav__link">
Container selection
</a>
</li>
@ -249,7 +254,7 @@
<li class="md-nav__item">
<a href="/watchtower/private-registries/" title="Private registries" class="md-nav__link">
<a href="/watchtower/private-registries/" class="md-nav__link">
Private registries
</a>
</li>
@ -261,7 +266,7 @@
<li class="md-nav__item">
<a href="/watchtower/linked-containers/" title="Linked containers" class="md-nav__link">
<a href="/watchtower/linked-containers/" class="md-nav__link">
Linked containers
</a>
</li>
@ -273,7 +278,7 @@
<li class="md-nav__item">
<a href="/watchtower/remote-hosts/" title="Remote hosts" class="md-nav__link">
<a href="/watchtower/remote-hosts/" class="md-nav__link">
Remote hosts
</a>
</li>
@ -285,7 +290,7 @@
<li class="md-nav__item">
<a href="/watchtower/secure-connections/" title="Secure connections" class="md-nav__link">
<a href="/watchtower/secure-connections/" class="md-nav__link">
Secure connections
</a>
</li>
@ -297,7 +302,7 @@
<li class="md-nav__item">
<a href="/watchtower/stop-signals/" title="Stop signals" class="md-nav__link">
<a href="/watchtower/stop-signals/" class="md-nav__link">
Stop signals
</a>
</li>
@ -309,7 +314,7 @@
<li class="md-nav__item">
<a href="/watchtower/lifecycle-hooks/" title="Lifecycle hooks" class="md-nav__link">
<a href="/watchtower/lifecycle-hooks/" class="md-nav__link">
Lifecycle hooks
</a>
</li>
@ -321,7 +326,7 @@
<li class="md-nav__item">
<a href="/watchtower/running-multiple-instances/" title="Running multiple instances" class="md-nav__link">
<a href="/watchtower/running-multiple-instances/" class="md-nav__link">
Running multiple instances
</a>
</li>
@ -369,8 +374,8 @@
</div>
<script src="/watchtower/assets/javascripts/vendor.77e55a48.min.js"></script>
<script src="/watchtower/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="/watchtower/assets/javascripts/vendor.0ac82a11.min.js"></script>
<script src="/watchtower/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({

@ -7,11 +7,12 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="http://containrrr.github.io/watchtower/arguments/">
<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">
@ -67,12 +70,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">
@ -101,7 +105,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>
@ -152,12 +156,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
@ -184,7 +189,7 @@
<li class="md-nav__item">
<a href=".." title="Home" class="md-nav__link">
<a href=".." class="md-nav__link">
Home
</a>
</li>
@ -196,7 +201,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>
@ -208,7 +213,7 @@
<li class="md-nav__item">
<a href="../usage-overview/" title="Usage overview" class="md-nav__link">
<a href="../usage-overview/" class="md-nav__link">
Usage overview
</a>
</li>
@ -231,7 +236,7 @@
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" title="Arguments" class="md-nav__link md-nav__link--active">
<a href="./" class="md-nav__link md-nav__link--active">
Arguments
</a>
@ -454,7 +459,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>
@ -466,7 +471,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>
@ -478,7 +483,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>
@ -490,7 +495,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>
@ -502,7 +507,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>
@ -514,7 +519,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>
@ -526,7 +531,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>
@ -538,7 +543,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>
@ -550,7 +555,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>
@ -795,129 +800,129 @@
will be the local Docker daemon, but you can override it with the <code>--host</code> option described in the next section). However, you
can restrict watchtower to monitoring a subset of the running containers by specifying the container names as arguments when
launching watchtower.</p>
<pre><code class="bash">$ docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower \
<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 <span class="se">\</span>
nginx redis
</code></pre>
</code></pre></div>
<p>In the example above, watchtower will only monitor the containers named "nginx" and "redis" for updates -- all of the other
running containers will be ignored. If you do not want watchtower to run as a daemon you can pass the <code>--run-once</code> flag and remove
the watchtower container after its execution.</p>
<pre><code class="bash">$ docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower \
--run-once \
<div class="codehilite"><pre><span></span><code>$ docker run --rm <span class="se">\</span>
-v /var/run/docker.sock:/var/run/docker.sock <span class="se">\</span>
containrrr/watchtower <span class="se">\</span>
--run-once <span class="se">\</span>
nginx redis
</code></pre>
</code></pre></div>
<p>In the example above, watchtower will execute an upgrade attempt on the containers named "nginx" and "redis". Using this mode will enable debugging output showing all actions performed, as usage is intended for interactive users. Once the attempt is completed, the container will exit and remove itself due to the <code>--rm</code> flag.</p>
<p>When no arguments are specified, watchtower will monitor all running containers.</p>
<h2 id="help">Help<a class="headerlink" href="#help" title="Permanent link">&para;</a></h2>
<p>Shows documentation about the supported flags.</p>
<pre><code> Argument: --help
Environment Variable: N/A
Type: N/A
Default: N/A
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --help</span>
<span class="err">Environment Variable: N/A</span>
<span class="err"> Type: N/A</span>
<span class="err"> Default: N/A</span>
</code></pre></div>
<h2 id="time_zone">Time Zone<a class="headerlink" href="#time_zone" title="Permanent link">&para;</a></h2>
<p>Sets the time zone to be used by WatchTower's logs and the optional Cron scheduling argument (--schedule). If this environment variable is not set, Watchtower will use the default time zone: UTC.
To find out the right value, see <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">this list</a>, find your location and use the value in <em>TZ Database Name</em>, e.g <em>Europe/Rome</em>. The timezome can alternatively be set by volume mounting your hosts /etc/timezone file. <code>-v /etc/timezone:/etc/timezone:ro</code></p>
<pre><code> Argument: N/A
Environment Variable: TZ
Type: String
Default: &quot;UTC&quot;
</code></pre>
To find out the right value, see <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">this list</a>, find your location and use the value in <em>TZ Database Name</em>, e.g <em>Europe/Rome</em>. The timezone can alternatively be set by volume mounting your hosts /etc/timezone file. <code>-v /etc/timezone:/etc/timezone:ro</code></p>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: N/A</span>
<span class="err">Environment Variable: TZ</span>
<span class="err"> Type: String</span>
<span class="err"> Default: &quot;UTC&quot;</span>
</code></pre></div>
<h2 id="cleanup">Cleanup<a class="headerlink" href="#cleanup" title="Permanent link">&para;</a></h2>
<p>Removes old images after updating. When this flag is specified, watchtower will remove the old image after restarting a container with a new image. Use this option to prevent the accumulation of orphaned images on your system as containers are updated.</p>
<pre><code> Argument: --cleanup
Environment Variable: WATCHTOWER_CLEANUP
Type: Boolean
Default: false
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --cleanup</span>
<span class="err">Environment Variable: WATCHTOWER_CLEANUP</span>
<span class="err"> Type: Boolean</span>
<span class="err"> Default: false</span>
</code></pre></div>
<h2 id="remove_attached_volumes">Remove attached volumes<a class="headerlink" href="#remove_attached_volumes" title="Permanent link">&para;</a></h2>
<p>Removes attached volumes after updating. When this flag is specified, watchtower will remove all attached volumes from the container before restarting with a new image. Use this option to force new volumes to be populated as containers are updated.</p>
<pre><code> Argument: --remove-volumes
Environment Variable: WATCHTOWER_REMOVE_VOLUMES
Type: Boolean
Default: false
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --remove-volumes</span>
<span class="err">Environment Variable: WATCHTOWER_REMOVE_VOLUMES</span>
<span class="err"> Type: Boolean</span>
<span class="err"> Default: false</span>
</code></pre></div>
<h2 id="debug">Debug<a class="headerlink" href="#debug" title="Permanent link">&para;</a></h2>
<p>Enable debug mode with verbose logging.</p>
<pre><code> Argument: --debug, -d
Environment Variable: WATCHTOWER_DEBUG
Type: Boolean
Default: false
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --debug, -d</span>
<span class="err">Environment Variable: WATCHTOWER_DEBUG</span>
<span class="err"> Type: Boolean</span>
<span class="err"> Default: false</span>
</code></pre></div>
<h2 id="trace">Trace<a class="headerlink" href="#trace" title="Permanent link">&para;</a></h2>
<p>Enable trace mode with very verbose logging. Caution: exposes credentials!</p>
<pre><code> Argument: --trace
Environment Variable: WATCHTOWER_TRACE
Type: Boolean
Default: false
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --trace</span>
<span class="err">Environment Variable: WATCHTOWER_TRACE</span>
<span class="err"> Type: Boolean</span>
<span class="err"> Default: false</span>
</code></pre></div>
<h2 id="ansi_colors">ANSI colors<a class="headerlink" href="#ansi_colors" title="Permanent link">&para;</a></h2>
<p>Disable ANSI color escape codes in log output.</p>
<pre><code> Argument: --no-color
Environment Variable: NO_COLOR
Type: Boolean
Default: false
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --no-color</span>
<span class="err">Environment Variable: NO_COLOR</span>
<span class="err"> Type: Boolean</span>
<span class="err"> Default: false</span>
</code></pre></div>
<h2 id="docker_host">Docker host<a class="headerlink" href="#docker_host" title="Permanent link">&para;</a></h2>
<p>Docker daemon socket to connect to. Can be pointed at a remote Docker host by specifying a TCP endpoint as "tcp://hostname:port".</p>
<pre><code> Argument: --host, -h
Environment Variable: DOCKER_HOST
Type: String
Default: &quot;unix:///var/run/docker.sock&quot;
</code></pre>
<div class="codehilite"><pre><span></span><code> <span class="n">Argument</span><span class="p">:</span> <span class="o">--</span><span class="n">host</span><span class="p">,</span> <span class="o">-</span><span class="n">H</span>
<span class="n">Environment</span> <span class="n">Variable</span><span class="p">:</span> <span class="n">DOCKER_HOST</span>
<span class="n">Type</span><span class="p">:</span> <span class="nb nb-Type">String</span>
<span class="n">Default</span><span class="p">:</span> <span class="s2">&quot;unix:///var/run/docker.sock&quot;</span>
</code></pre></div>
<h2 id="docker_api_version">Docker API version<a class="headerlink" href="#docker_api_version" title="Permanent link">&para;</a></h2>
<p>The API version to use by the Docker client for connecting to the Docker daemon. The minimum supported version is 1.24.</p>
<pre><code> Argument: --api-version, -a
Environment Variable: DOCKER_API_VERSION
Type: String
Default: &quot;1.24&quot;
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --api-version, -a</span>
<span class="err">Environment Variable: DOCKER_API_VERSION</span>
<span class="err"> Type: String</span>
<span class="err"> Default: &quot;1.24&quot;</span>
</code></pre></div>
<h2 id="include_stopped">Include stopped<a class="headerlink" href="#include_stopped" title="Permanent link">&para;</a></h2>
<p>Will also include created and exited containers.</p>
<pre><code> Argument: --include-stopped
Environment Variable: WATCHTOWER_INCLUDE_STOPPED
Type: Boolean
Default: false
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --include-stopped</span>
<span class="err">Environment Variable: WATCHTOWER_INCLUDE_STOPPED</span>
<span class="err"> Type: Boolean</span>
<span class="err"> Default: false</span>
</code></pre></div>
<h2 id="revive_stopped">Revive stopped<a class="headerlink" href="#revive_stopped" title="Permanent link">&para;</a></h2>
<p>Start any stopped containers that have had their image updated. This argument is only usable with the <code>--include-stopped</code> argument.</p>
<pre><code> Argument: --revive-stopped
Environment Variable: WATCHTOWER_REVIVE_STOPPED
Type: Boolean
Default: false
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --revive-stopped</span>
<span class="err">Environment Variable: WATCHTOWER_REVIVE_STOPPED</span>
<span class="err"> Type: Boolean</span>
<span class="err"> Default: false</span>
</code></pre></div>
<h2 id="poll_interval">Poll interval<a class="headerlink" href="#poll_interval" title="Permanent link">&para;</a></h2>
<p>Poll interval (in seconds). This value controls how frequently watchtower will poll for new images. Either <code>--schedule</code> or a poll interval can be defined, but not both.</p>
<pre><code> Argument: --interval, -i
Environment Variable: WATCHTOWER_POLL_INTERVAL
Type: Integer
Default: 300
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --interval, -i</span>
<span class="err">Environment Variable: WATCHTOWER_POLL_INTERVAL</span>
<span class="err"> Type: Integer</span>
<span class="err"> Default: 86400 (24 hours)</span>
</code></pre></div>
<h2 id="filter_by_enable_label">Filter by enable label<a class="headerlink" href="#filter_by_enable_label" title="Permanent link">&para;</a></h2>
<p>Update containers that have a <code>com.centurylinklabs.watchtower.enable</code> label set to true.</p>
<pre><code> Argument: --label-enable
Environment Variable: WATCHTOWER_LABEL_ENABLE
Type: Boolean
Default: false
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --label-enable</span>
<span class="err">Environment Variable: WATCHTOWER_LABEL_ENABLE</span>
<span class="err"> Type: Boolean</span>
<span class="err"> Default: false</span>
</code></pre></div>
<h2 id="filter_by_disable_label">Filter by disable label<a class="headerlink" href="#filter_by_disable_label" title="Permanent link">&para;</a></h2>
<p><strong>Do not</strong> update containers that have <code>com.centurylinklabs.watchtower.enable</code> label set to false and no <code>--label-enable</code> argument is passed. Note that only one or the other (targeting by enable label) can be used at the same time to target containers.</p>
@ -927,106 +932,106 @@ Environment Variable: WATCHTOWER_LABEL_ENABLE
<h3 id="please_note">⚠️ Please note<a class="headerlink" href="#please_note" title="Permanent link">&para;</a></h3>
<p>Due to Docker API limitations the latest image will still be pulled from the registry.</p>
</blockquote>
<pre><code> Argument: --monitor-only
Environment Variable: WATCHTOWER_MONITOR_ONLY
Type: Boolean
Default: false
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --monitor-only</span>
<span class="err">Environment Variable: WATCHTOWER_MONITOR_ONLY</span>
<span class="err"> Type: Boolean</span>
<span class="err"> Default: false</span>
</code></pre></div>
<p>Note that monitor-only can also be specified on a per-container basis with the <code>com.centurylinklabs.watchtower.monitor-only</code> label set on those containers.</p>
<h2 id="without_restarting_containers">Without restarting containers<a class="headerlink" href="#without_restarting_containers" title="Permanent link">&para;</a></h2>
<p>Do not restart containers after updating. This option can be useful when the start of the containers
is managed by an external system such as systemd.</p>
<pre><code> Argument: --no-restart
Environment Variable: WATCHTOWER_NO_RESTART
Type: Boolean
Default: false
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --no-restart</span>
<span class="err">Environment Variable: WATCHTOWER_NO_RESTART</span>
<span class="err"> Type: Boolean</span>
<span class="err"> Default: false</span>
</code></pre></div>
<h2 id="without_pulling_new_images">Without pulling new images<a class="headerlink" href="#without_pulling_new_images" title="Permanent link">&para;</a></h2>
<p>Do not pull new images. When this flag is specified, watchtower will not attempt to pull
new images from the registry. Instead it will only monitor the local image cache for changes.
Use this option if you are building new images directly on the Docker host without pushing
them to a registry.</p>
<pre><code> Argument: --no-pull
Environment Variable: WATCHTOWER_NO_PULL
Type: Boolean
Default: false
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --no-pull</span>
<span class="err">Environment Variable: WATCHTOWER_NO_PULL</span>
<span class="err"> Type: Boolean</span>
<span class="err"> Default: false</span>
</code></pre></div>
<h2 id="without_sending_a_startup_message">Without sending a startup message<a class="headerlink" href="#without_sending_a_startup_message" title="Permanent link">&para;</a></h2>
<p>Do not send a message after watchtower started. Otherwise there will be an info-level notification.</p>
<pre><code> Argument: --no-startup-message
Environment Variable: WATCHTOWER_NO_STARTUP_MESSAGE
Type: Boolean
Default: false
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --no-startup-message</span>
<span class="err">Environment Variable: WATCHTOWER_NO_STARTUP_MESSAGE</span>
<span class="err"> Type: Boolean</span>
<span class="err"> Default: false</span>
</code></pre></div>
<h2 id="run_once">Run once<a class="headerlink" href="#run_once" title="Permanent link">&para;</a></h2>
<p>Run an update attempt against a container name list one time immediately and exit.</p>
<pre><code> Argument: --run-once
Environment Variable: WATCHTOWER_RUN_ONCE
Type: Boolean
Default: false
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --run-once</span>
<span class="err">Environment Variable: WATCHTOWER_RUN_ONCE</span>
<span class="err"> Type: Boolean</span>
<span class="err"> Default: false</span>
</code></pre></div>
<h2 id="http_api_mode">HTTP API Mode<a class="headerlink" href="#http_api_mode" title="Permanent link">&para;</a></h2>
<p>Runs Watchtower in HTTP API mode, only allowing image updates to be triggered by an HTTP request.</p>
<pre><code> Argument: --http-api
Environment Variable: WATCHTOWER_HTTP_API
Type: Boolean
Default: false
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --http-api</span>
<span class="err">Environment Variable: WATCHTOWER_HTTP_API</span>
<span class="err"> Type: Boolean</span>
<span class="err"> Default: false</span>
</code></pre></div>
<h2 id="http_api_token">HTTP API Token<a class="headerlink" href="#http_api_token" title="Permanent link">&para;</a></h2>
<p>Sets an authentication token to HTTP API requests.</p>
<pre><code> Argument: --http-api-token
Environment Variable: WATCHTOWER_HTTP_API_TOKEN
Type: String
Default: -
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --http-api-token</span>
<span class="err">Environment Variable: WATCHTOWER_HTTP_API_TOKEN</span>
<span class="err"> Type: String</span>
<span class="err"> Default: -</span>
</code></pre></div>
<h2 id="filter_by_scope">Filter by scope<a class="headerlink" href="#filter_by_scope" title="Permanent link">&para;</a></h2>
<p>Update containers that have a <code>com.centurylinklabs.watchtower.scope</code> label set with the same value as the given argument. This enables <a href="https://containrrr.github.io/watchtower/running-multiple-instances">running multiple instances</a>.</p>
<pre><code> Argument: --scope
Environment Variable: WATCHTOWER_SCOPE
Type: String
Default: -
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --scope</span>
<span class="err">Environment Variable: WATCHTOWER_SCOPE</span>
<span class="err"> Type: String</span>
<span class="err"> Default: -</span>
</code></pre></div>
<h2 id="scheduling">Scheduling<a class="headerlink" href="#scheduling" title="Permanent link">&para;</a></h2>
<p><a href="https://pkg.go.dev/github.com/robfig/cron@v1.2.0?tab=doc#hdr-CRON_Expression_Format">Cron expression</a> in 6 fields (rather than the traditional 5) which defines when and how often to check for new images. Either <code>--interval</code> or the schedule expression
can be defined, but not both. An example: <code>--schedule "0 0 4 * * *"</code></p>
<pre><code> Argument: --schedule, -s
Environment Variable: WATCHTOWER_SCHEDULE
Type: String
Default: -
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --schedule, -s</span>
<span class="err">Environment Variable: WATCHTOWER_SCHEDULE</span>
<span class="err"> Type: String</span>
<span class="err"> Default: -</span>
</code></pre></div>
<h2 id="rolling_restart">Rolling restart<a class="headerlink" href="#rolling_restart" title="Permanent link">&para;</a></h2>
<p>Restart one image at time instead of stopping and starting all at once. Useful in conjunction with lifecycle hooks
to implement zero-downtime deploy.</p>
<pre><code> Argument: --rolling-restart
Environment Variable: WATCHTOWER_ROLLING_RESTART
Type: Boolean
Default: false
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --rolling-restart</span>
<span class="err">Environment Variable: WATCHTOWER_ROLLING_RESTART</span>
<span class="err"> Type: Boolean</span>
<span class="err"> Default: false</span>
</code></pre></div>
<h2 id="wait_until_timeout">Wait until timeout<a class="headerlink" href="#wait_until_timeout" title="Permanent link">&para;</a></h2>
<p>Timeout before the container is forcefully stopped. When set, this option will change the default (<code>10s</code>) wait time to the given value. An example: <code>--stop-timeout 30s</code> will set the timeout to 30 seconds.</p>
<pre><code> Argument: --stop-timeout
Environment Variable: WATCHTOWER_TIMEOUT
Type: Duration
Default: 10s
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --stop-timeout</span>
<span class="err">Environment Variable: WATCHTOWER_TIMEOUT</span>
<span class="err"> Type: Duration</span>
<span class="err"> Default: 10s</span>
</code></pre></div>
<h2 id="tls_verification">TLS Verification<a class="headerlink" href="#tls_verification" title="Permanent link">&para;</a></h2>
<p>Use TLS when connecting to the Docker socket and verify the server's certificate. See below for options used to configure notifications.</p>
<pre><code> Argument: --tlsverify
Environment Variable: DOCKER_TLS_VERIFY
Type: Boolean
Default: false
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="err"> Argument: --tlsverify</span>
<span class="err">Environment Variable: DOCKER_TLS_VERIFY</span>
<span class="err"> Type: Boolean</span>
<span class="err"> Default: false</span>
</code></pre></div>
@ -1045,7 +1050,7 @@ Environment Variable: DOCKER_TLS_VERIFY
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid" aria-label="Footer">
<a href="../usage-overview/" title="Usage overview" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<a href="../usage-overview/" 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>
@ -1060,7 +1065,7 @@ Environment Variable: DOCKER_TLS_VERIFY
</a>
<a href="../notifications/" title="Notifications" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
<a href="../notifications/" 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">
@ -1093,8 +1098,8 @@ Environment Variable: DOCKER_TLS_VERIFY
</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({

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -7,11 +7,12 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="http://containrrr.github.io/watchtower/container-selection/">
<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">
@ -67,12 +70,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">
@ -101,7 +105,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>
@ -152,12 +156,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
@ -184,7 +189,7 @@
<li class="md-nav__item">
<a href=".." title="Home" class="md-nav__link">
<a href=".." class="md-nav__link">
Home
</a>
</li>
@ -196,7 +201,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>
@ -208,7 +213,7 @@
<li class="md-nav__item">
<a href="../usage-overview/" title="Usage overview" class="md-nav__link">
<a href="../usage-overview/" class="md-nav__link">
Usage overview
</a>
</li>
@ -220,7 +225,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>
@ -232,7 +237,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>
@ -255,7 +260,7 @@
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" title="Container selection" class="md-nav__link md-nav__link--active">
<a href="./" class="md-nav__link md-nav__link--active">
Container selection
</a>
@ -297,7 +302,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>
@ -309,7 +314,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>
@ -321,7 +326,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>
@ -333,7 +338,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>
@ -345,7 +350,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>
@ -357,7 +362,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>
@ -369,7 +374,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>
@ -437,20 +442,20 @@
</ul>
<h2 id="full_exclude">Full Exclude<a class="headerlink" href="#full_exclude" title="Permanent link">&para;</a></h2>
<p>If you need to exclude some containers, set the <em>com.centurylinklabs.watchtower.enable</em> label to <code>false</code>.</p>
<pre><code class="docker">LABEL com.centurylinklabs.watchtower.enable=&quot;false&quot;
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="k">LABEL</span> com.centurylinklabs.watchtower.enable<span class="o">=</span><span class="s2">&quot;false&quot;</span>
</code></pre></div>
<p>Or, it can be specified as part of the <code>docker run</code> command line:</p>
<pre><code class="bash">docker run -d --label=com.centurylinklabs.watchtower.enable=false someimage
</code></pre>
<div class="codehilite"><pre><span></span><code>docker run -d --label<span class="o">=</span>com.centurylinklabs.watchtower.enable<span class="o">=</span><span class="nb">false</span> someimage
</code></pre></div>
<p>If you need to <a href="https://containrrr.github.io/watchtower/arguments/#filter_by_enable_label">include only containers with the enable label</a>, pass the <code>--label-enable</code> flag or the <code>WATCHTOWER_LABEL_ENABLE</code> environment variable on startup and set the <em>com.centurylinklabs.watchtower.enable</em> label with a value of <code>true</code> for the containers you want to watch.</p>
<pre><code class="docker">LABEL com.centurylinklabs.watchtower.enable=&quot;true&quot;
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="k">LABEL</span> com.centurylinklabs.watchtower.enable<span class="o">=</span><span class="s2">&quot;true&quot;</span>
</code></pre></div>
<p>Or, it can be specified as part of the <code>docker run</code> command line:</p>
<pre><code class="bash">docker run -d --label=com.centurylinklabs.watchtower.enable=true someimage
</code></pre>
<div class="codehilite"><pre><span></span><code>docker run -d --label<span class="o">=</span>com.centurylinklabs.watchtower.enable<span class="o">=</span><span class="nb">true</span> someimage
</code></pre></div>
<p>If you wish to create a monitoring scope, you will need to <a href="https://containrrr.github.io/watchtower/running-multiple-instances">run multiple instances and set a scope for each of them</a>.</p>
<p>Watchtower filters running containers by testing them against each configured criteria. A container is monitored if all criteria are met. For example:
@ -459,12 +464,12 @@
<h2 id="monitor_only">Monitor Only<a class="headerlink" href="#monitor_only" title="Permanent link">&para;</a></h2>
<p>Individual containers can be marked to only be monitored (without being updated).</p>
<p>To do so, set the <em>com.centurylinklabs.watchtower.monitor-only</em> label to <code>true</code> on that container.</p>
<pre><code class="docker">LABEL com.centurylinklabs.watchtower.monitor-only=&quot;true&quot;
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="k">LABEL</span> com.centurylinklabs.watchtower.monitor-only<span class="o">=</span><span class="s2">&quot;true&quot;</span>
</code></pre></div>
<p>Or, it can be specified as part of the <code>docker run</code> command line:</p>
<pre><code class="bash">docker run -d --label=com.centurylinklabs.watchtower.monitor-only=true someimage
</code></pre>
<div class="codehilite"><pre><span></span><code>docker run -d --label<span class="o">=</span>com.centurylinklabs.watchtower.monitor-only<span class="o">=</span><span class="nb">true</span> someimage
</code></pre></div>
<p>When the label is specified on a container, watchtower treats that container exactly as if <a href="https://containrrr.dev/watchtower/arguments/#without_updating_containers"><code>WATCHTOWER_MONITOR_ONLY</code></a> was set, but the effect is limited to the individual container. </p>
@ -485,7 +490,7 @@
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid" aria-label="Footer">
<a href="../notifications/" title="Notifications" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<a href="../notifications/" 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>
@ -500,7 +505,7 @@
</a>
<a href="../private-registries/" title="Private registries" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
<a href="../private-registries/" 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">
@ -533,8 +538,8 @@
</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({

@ -7,11 +7,12 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="http://containrrr.github.io/watchtower/http-api-mode/">
<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>
@ -203,7 +208,7 @@
<li class="md-nav__item">
<a href="../usage-overview/" title="Usage overview" class="md-nav__link">
<a href="../usage-overview/" class="md-nav__link">
Usage overview
</a>
</li>
@ -215,7 +220,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>
@ -227,7 +232,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>
@ -239,7 +244,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>
@ -251,7 +256,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>
@ -263,7 +268,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>
@ -275,7 +280,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>
@ -287,7 +292,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>
@ -299,7 +304,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>
@ -311,7 +316,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>
@ -323,7 +328,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>
@ -354,30 +359,30 @@
</ul>
<hr />
<p>To enable this mode, use the flag <code>--http-api</code>. For example, in a Docker Compose config file:</p>
<pre><code class="json">version: '3'
services:
app-monitored-by-watchtower:
image: myapps/monitored-by-watchtower
labels:
- &quot;com.centurylinklabs.watchtower.enable=true&quot;
watchtower:
image: containrrr/watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --debug --http-api
environment:
- WATCHTOWER_HTTP_API_TOKEN=mytoken
labels:
- &quot;com.centurylinklabs.watchtower.enable=false&quot;
ports:
- 8080:8080
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="nt">version</span><span class="p">:</span> <span class="s">&#39;3&#39;</span>
<span class="nt">services</span><span class="p">:</span>
<span class="nt">app-monitored-by-watchtower</span><span class="p">:</span>
<span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">myapps/monitored-by-watchtower</span>
<span class="nt">labels</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="s">&quot;com.centurylinklabs.watchtower.enable=true&quot;</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="nt">command</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">--debug --http-api</span>
<span class="nt">environment</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">WATCHTOWER_HTTP_API_TOKEN=mytoken</span>
<span class="nt">labels</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="s">&quot;com.centurylinklabs.watchtower.enable=false&quot;</span>
<span class="nt">ports</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">8080:8080</span>
</code></pre></div>
<p>Notice that there is an environment variable named WATCHTOWER_HTTP_API_TOKEN. To prevent external services from accidentally triggering image updates, all of the requests have to contain a "Token" field, valued as the token defined in WATCHTOWER_HTTP_API_TOKEN, in their headers. In this case, there is a port bind to the host machine, allowing to request localhost:8080 to reach Watchtower. The following <code>curl</code> command would trigger an image update:</p>
<pre><code class="bash">curl -H &quot;Token: mytoken&quot; localhost:8080/v1/update
</code></pre>
<div class="codehilite"><pre><span></span><code>curl -H <span class="s2">&quot;Token: mytoken&quot;</span> localhost:8080/v1/update
</code></pre></div>
@ -409,8 +414,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({

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

@ -7,11 +7,12 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="http://containrrr.github.io/watchtower/">
<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">
@ -67,12 +70,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">
@ -101,7 +105,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>
@ -152,12 +156,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
@ -195,7 +200,7 @@
<span class="md-nav__icon md-icon"></span>
</label>
<a href="." title="Home" class="md-nav__link md-nav__link--active">
<a href="." class="md-nav__link md-nav__link--active">
Home
</a>
@ -230,7 +235,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>
@ -242,7 +247,7 @@
<li class="md-nav__item">
<a href="usage-overview/" title="Usage overview" class="md-nav__link">
<a href="usage-overview/" class="md-nav__link">
Usage overview
</a>
</li>
@ -254,7 +259,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>
@ -266,7 +271,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>
@ -278,7 +283,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>
@ -290,7 +295,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>
@ -302,7 +307,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>
@ -314,7 +319,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>
@ -326,7 +331,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>
@ -338,7 +343,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>
@ -350,7 +355,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>
@ -362,7 +367,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>
@ -413,7 +418,10 @@
</a>
<h1 align="center">
<p style="text-align: center; margin-left: 1.6rem;">
<img src="./images/logo-450px.png" width="450" />
</p>
<h1 align="center">
Watchtower
</h1>
@ -444,21 +452,21 @@
<a href="https://www.codacy.com/app/simskij/watchtower?utm_source=github.com&utm_medium=referral&utm_content=containrrr/watchtower&utm_campaign=Badge_Coverage">
<img alt="Codacy Badge" src="https://api.codacy.com/project/badge/Coverage/3a4d0fcfd26d45b09b1d7ea3c8c13744" />
</a>
<a href="https://gitter.im/containrrr/watchtower?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge">
<img alt="Join the chat at https://gitter.im/containrrr/watchtower" src="https://badges.gitter.im/containrrr/watchtower.svg" />
</a>
<a href="#contributors">
<img alt="All Contributors" src="https://img.shields.io/badge/all_contributors-30-orange.svg?style=flat-square" />
</a>
<a href="https://hub.docker.com/r/containrrr/watchtower">
<img alt="Pulls from DockerHub" src="https://img.shields.io/docker/pulls/containrrr/watchtower.svg?style=flat-square" />
</a>
</p>
<h2 id="quick_start">Quick Start<a class="headerlink" href="#quick_start" title="Permanent link">&para;</a></h2>
<p>With watchtower you can update the running version of your containerized app simply by pushing a new image to the Docker Hub or your own image registry. Watchtower will pull down your new image, gracefully shut down your existing container and restart it with the same options that were used when it was deployed initially. Run the watchtower container with the following command:</p>
<pre><code>$ 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>
@ -478,7 +486,7 @@
<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--next" rel="next">
<a href="introduction/" 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">
@ -511,8 +519,8 @@
</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({

@ -7,11 +7,12 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="http://containrrr.github.io/watchtower/introduction/">
<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>
@ -197,7 +202,7 @@
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<a href="./" title="Introduction" class="md-nav__link md-nav__link--active">
<a href="./" class="md-nav__link md-nav__link--active">
Introduction
</a>
@ -210,7 +215,7 @@
<li class="md-nav__item">
<a href="../usage-overview/" title="Usage overview" class="md-nav__link">
<a href="../usage-overview/" class="md-nav__link">
Usage overview
</a>
</li>
@ -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,11 +363,11 @@
<p>Watchtower is an application that will monitor your running Docker containers and watch for changes to the images that those containers were originally started from. If watchtower detects that an image has changed, it will automatically restart the container using the new image.</p>
<p>With watchtower you can update the running version of your containerized app simply by pushing a new image to the Docker Hub or your own image registry. Watchtower will pull down your new image, gracefully shut down your existing container and restart it with the same options that were used when it was deployed initially.</p>
<p>For example, let's say you were running watchtower along with an instance of <em>centurylink/wetty-cli</em> image:</p>
<pre><code class="bash">$ docker ps
<div class="codehilite"><pre><span></span><code>$ docker ps
CONTAINER ID IMAGE STATUS PORTS NAMES
967848166a45 centurylink/wetty-cli Up 10 minutes 0.0.0.0:8080-&gt;3000/tcp wetty
6cc4d2a9d1a5 containrrr/watchtower Up 15 minutes watchtower
</code></pre>
967848166a45 centurylink/wetty-cli Up <span class="m">10</span> minutes <span class="m">0</span>.0.0.0:8080-&gt;3000/tcp wetty
6cc4d2a9d1a5 containrrr/watchtower Up <span class="m">15</span> minutes watchtower
</code></pre></div>
<p>Every few minutes watchtower will pull the latest <em>centurylink/wetty-cli</em> image and compare it to the one that was used to run the "wetty" container. If it sees that the image has changed it will stop/remove the "wetty" container and then restart it using the new image and the same <code>docker run</code> options that were used to start the container initially (in this case, that would include the <code>-p 8080:3000</code> port mapping).</p>
@ -383,7 +388,7 @@ CONTAINER ID IMAGE STATUS PORTS
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid" aria-label="Footer">
<a href=".." title="Home" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<a href=".." 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>
@ -398,7 +403,7 @@ CONTAINER ID IMAGE STATUS PORTS
</a>
<a href="../usage-overview/" title="Usage overview" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
<a href="../usage-overview/" 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">
@ -431,8 +436,8 @@ CONTAINER ID IMAGE STATUS PORTS
</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({

@ -7,11 +7,12 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="http://containrrr.github.io/watchtower/lifecycle-hooks/">
<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">
@ -67,12 +70,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">
@ -101,7 +105,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>
@ -152,12 +156,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
@ -184,7 +189,7 @@
<li class="md-nav__item">
<a href=".." title="Home" class="md-nav__link">
<a href=".." class="md-nav__link">
Home
</a>
</li>
@ -196,7 +201,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>
@ -208,7 +213,7 @@
<li class="md-nav__item">
<a href="../usage-overview/" title="Usage overview" class="md-nav__link">
<a href="../usage-overview/" class="md-nav__link">
Usage overview
</a>
</li>
@ -220,7 +225,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>
@ -232,7 +237,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>
@ -244,7 +249,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>
@ -256,7 +261,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>
@ -268,7 +273,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>
@ -280,7 +285,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>
@ -292,7 +297,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>
@ -304,7 +309,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>
@ -327,7 +332,7 @@
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" title="Lifecycle hooks" class="md-nav__link md-nav__link--active">
<a href="./" class="md-nav__link md-nav__link--active">
Lifecycle hooks
</a>
@ -402,7 +407,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>
@ -540,20 +545,20 @@ container to provide the <code>sh</code> executable.</p>
</tbody>
</table>
<p>These labels can be declared as instructions in a Dockerfile (with some example .sh files):</p>
<pre><code class="docker">LABEL com.centurylinklabs.watchtower.lifecycle.pre-check=&quot;/sync.sh&quot;
LABEL com.centurylinklabs.watchtower.lifecycle.pre-update=&quot;/dump-data.sh&quot;
LABEL com.centurylinklabs.watchtower.lifecycle.post-update=&quot;/restore-data.sh&quot;
LABEL com.centurylinklabs.watchtower.lifecycle.post-check=&quot;/send-heartbeat.sh&quot;
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="k">LABEL</span> com.centurylinklabs.watchtower.lifecycle.pre-check<span class="o">=</span><span class="s2">&quot;/sync.sh&quot;</span>
<span class="k">LABEL</span> com.centurylinklabs.watchtower.lifecycle.pre-update<span class="o">=</span><span class="s2">&quot;/dump-data.sh&quot;</span>
<span class="k">LABEL</span> com.centurylinklabs.watchtower.lifecycle.post-update<span class="o">=</span><span class="s2">&quot;/restore-data.sh&quot;</span>
<span class="k">LABEL</span> com.centurylinklabs.watchtower.lifecycle.post-check<span class="o">=</span><span class="s2">&quot;/send-heartbeat.sh&quot;</span>
</code></pre></div>
<p>Or be specified as part of the <code>docker run</code> command line:</p>
<pre><code class="bash">docker run -d \
--label=com.centurylinklabs.watchtower.lifecycle.pre-check=&quot;/sync.sh&quot; \
--label=com.centurylinklabs.watchtower.lifecycle.pre-update=&quot;/dump-data.sh&quot; \
--label=com.centurylinklabs.watchtower.lifecycle.post-update=&quot;/restore-data.sh&quot; \
<div class="codehilite"><pre><span></span><code>docker run -d <span class="se">\</span>
--label<span class="o">=</span>com.centurylinklabs.watchtower.lifecycle.pre-check<span class="o">=</span><span class="s2">&quot;/sync.sh&quot;</span> <span class="se">\</span>
--label<span class="o">=</span>com.centurylinklabs.watchtower.lifecycle.pre-update<span class="o">=</span><span class="s2">&quot;/dump-data.sh&quot;</span> <span class="se">\</span>
--label<span class="o">=</span>com.centurylinklabs.watchtower.lifecycle.post-update<span class="o">=</span><span class="s2">&quot;/restore-data.sh&quot;</span> <span class="se">\</span>
someimage
--label=com.centurylinklabs.watchtower.lifecycle.post-check=&quot;/send-heartbeat.sh&quot; \
</code></pre>
--label<span class="o">=</span>com.centurylinklabs.watchtower.lifecycle.post-check<span class="o">=</span><span class="s2">&quot;/send-heartbeat.sh&quot;</span> <span class="se">\</span>
</code></pre></div>
<h3 id="timeouts">Timeouts<a class="headerlink" href="#timeouts" title="Permanent link">&para;</a></h3>
<p>The timeout for all lifecycle commands is 60 seconds. After that, a timeout will
@ -586,7 +591,7 @@ log statement containing the exit code will be reported.</p>
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid" aria-label="Footer">
<a href="../stop-signals/" title="Stop signals" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<a href="../stop-signals/" 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>
@ -601,7 +606,7 @@ log statement containing the exit code will be reported.</p>
</a>
<a href="../running-multiple-instances/" title="Running multiple instances" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
<a href="../running-multiple-instances/" 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">
@ -634,8 +639,8 @@ log statement containing the exit code will be reported.</p>
</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({

@ -7,11 +7,12 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="http://containrrr.github.io/watchtower/linked-containers/">
<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>
@ -203,7 +208,7 @@
<li class="md-nav__item">
<a href="../usage-overview/" title="Usage overview" class="md-nav__link">
<a href="../usage-overview/" class="md-nav__link">
Usage overview
</a>
</li>
@ -215,7 +220,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>
@ -227,7 +232,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>
@ -239,7 +244,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>
@ -251,7 +256,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>
@ -269,7 +274,7 @@
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<a href="./" title="Linked containers" class="md-nav__link md-nav__link--active">
<a href="./" class="md-nav__link md-nav__link--active">
Linked containers
</a>
@ -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>
@ -376,7 +381,7 @@
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid" aria-label="Footer">
<a href="../private-registries/" title="Private registries" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<a href="../private-registries/" 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>
@ -391,7 +396,7 @@
</a>
<a href="../remote-hosts/" title="Remote hosts" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
<a href="../remote-hosts/" 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">
@ -424,8 +429,8 @@
</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({

@ -7,11 +7,12 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="http://containrrr.github.io/watchtower/notifications/">
<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">
@ -67,12 +70,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">
@ -101,7 +105,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>
@ -152,12 +156,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
@ -184,7 +189,7 @@
<li class="md-nav__item">
<a href=".." title="Home" class="md-nav__link">
<a href=".." class="md-nav__link">
Home
</a>
</li>
@ -196,7 +201,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>
@ -208,7 +213,7 @@
<li class="md-nav__item">
<a href="../usage-overview/" title="Usage overview" class="md-nav__link">
<a href="../usage-overview/" class="md-nav__link">
Usage overview
</a>
</li>
@ -220,7 +225,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>
@ -245,7 +250,7 @@
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" title="Notifications" class="md-nav__link md-nav__link--active">
<a href="./" class="md-nav__link md-nav__link--active">
Notifications
</a>
@ -330,7 +335,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>
@ -342,7 +347,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>
@ -354,7 +359,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>
@ -366,7 +371,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>
@ -378,7 +383,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>
@ -390,7 +395,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>
@ -402,7 +407,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>
@ -414,7 +419,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>
@ -550,66 +555,66 @@ The types of notifications to send are set by passing a comma-separated list of
<li><code>--notification-email-subjecttag</code> (env. <code>WATCHTOWER_NOTIFICATION_EMAIL_SUBJECTTAG</code>): Prefix to include in the subject tag. Useful when running multiple watchtowers.</li>
</ul>
<p>Example:</p>
<pre><code class="bash">docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
-e WATCHTOWER_NOTIFICATIONS=email \
-e WATCHTOWER_NOTIFICATION_EMAIL_FROM=fromaddress@gmail.com \
-e WATCHTOWER_NOTIFICATION_EMAIL_TO=toaddress@gmail.com \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER=smtp.gmail.com \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=587 \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER=fromaddress@gmail.com \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD=app_password \
-e WATCHTOWER_NOTIFICATION_EMAIL_DELAY=2 \
<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>
-e <span class="nv">WATCHTOWER_NOTIFICATIONS</span><span class="o">=</span>email <span class="se">\</span>
-e <span class="nv">WATCHTOWER_NOTIFICATION_EMAIL_FROM</span><span class="o">=</span>fromaddress@gmail.com <span class="se">\</span>
-e <span class="nv">WATCHTOWER_NOTIFICATION_EMAIL_TO</span><span class="o">=</span>toaddress@gmail.com <span class="se">\</span>
-e <span class="nv">WATCHTOWER_NOTIFICATION_EMAIL_SERVER</span><span class="o">=</span>smtp.gmail.com <span class="se">\</span>
-e <span class="nv">WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT</span><span class="o">=</span><span class="m">587</span> <span class="se">\ </span>
-e <span class="nv">WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER</span><span class="o">=</span>fromaddress@gmail.com <span class="se">\</span>
-e <span class="nv">WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD</span><span class="o">=</span>app_password <span class="se">\</span>
-e <span class="nv">WATCHTOWER_NOTIFICATION_EMAIL_DELAY</span><span class="o">=</span><span class="m">2</span> <span class="se">\</span>
containrrr/watchtower
</code></pre>
</code></pre></div>
<p>The previous example assumes, that you already have an SMTP server up and running you can connect to. If you don't or you want to bring up watchtower with your own simple SMTP relay the following <code>docker-compose.yml</code> might be a good start for you.</p>
<p>The following example assumes, that your domain is called <code>your-domain.com</code> and that you are going to use a certificate valid for <code>smtp.your-domain.com</code>. This hostname has to be used as <code>WATCHTOWER_NOTIFICATION_EMAIL_SERVER</code> otherwise the TLS connection is going to fail with <code>Failed to send notification email</code> or <code>connect: connection refused</code>. We also have to add a network for this setup in order to add an alias to it. If you also want to enable DKIM or other features on the SMTP server, you will find more information at <a href="https://hub.docker.com/r/freinet/postfix-relay">freinet/postfix-relay</a>.</p>
<p>Example including an SMTP relay:</p>
<pre><code class="yaml">---
version: &quot;3.8&quot;
services:
watchtower:
image: containrrr/watchtower:latest
container_name: watchtower
environment:
WATCHTOWER_MONITOR_ONLY: &quot;true&quot;
WATCHTOWER_NOTIFICATIONS: email
WATCHTOWER_NOTIFICATION_EMAIL_FROM: from-address@your-domain.com
WATCHTOWER_NOTIFICATION_EMAIL_TO: to-address@your-domain.com
# you have to use a network alias here, if you use your own certificate
WATCHTOWER_NOTIFICATION_EMAIL_SERVER: smtp.your-domain.com
WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT: 25
WATCHTOWER_NOTIFICATION_EMAIL_DELAY: 2
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- watchtower
depends_on:
- postfix
# SMTP needed to send out status emails
postfix:
image: freinet/postfix-relay:latest
expose:
- 25
environment:
MAILNAME: somename.your-domain.com
TLS_KEY: &quot;/etc/ssl/domains/your-domain.com/your-domain.com.key&quot;
TLS_CRT: &quot;/etc/ssl/domains/your-domain.com/your-domain.com.crt&quot;
TLS_CA: &quot;/etc/ssl/domains/your-domain.com/intermediate.crt&quot;
volumes:
- /etc/ssl/domains/your-domain.com/:/etc/ssl/domains/your-domain.com/:ro
networks:
watchtower:
# this alias is really important to make your certificate work
aliases:
- smtp.your-domain.com
networks:
watchtower:
external: false
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="nn">---</span>
<span class="nt">version</span><span class="p">:</span> <span class="s">&quot;3.8&quot;</span>
<span class="nt">services</span><span class="p">:</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:latest</span>
<span class="nt">container_name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">watchtower</span>
<span class="nt">environment</span><span class="p">:</span>
<span class="nt">WATCHTOWER_MONITOR_ONLY</span><span class="p">:</span> <span class="s">&quot;true&quot;</span>
<span class="nt">WATCHTOWER_NOTIFICATIONS</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">email</span>
<span class="nt">WATCHTOWER_NOTIFICATION_EMAIL_FROM</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">from-address@your-domain.com</span>
<span class="nt">WATCHTOWER_NOTIFICATION_EMAIL_TO</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">to-address@your-domain.com</span>
<span class="c1"># you have to use a network alias here, if you use your own certificate</span>
<span class="nt">WATCHTOWER_NOTIFICATION_EMAIL_SERVER</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">smtp.your-domain.com</span>
<span class="nt">WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">25</span>
<span class="nt">WATCHTOWER_NOTIFICATION_EMAIL_DELAY</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">2</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="nt">networks</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">watchtower</span>
<span class="nt">depends_on</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">postfix</span>
<span class="c1"># SMTP needed to send out status emails</span>
<span class="nt">postfix</span><span class="p">:</span>
<span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">freinet/postfix-relay:latest</span>
<span class="nt">expose</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">25</span>
<span class="nt">environment</span><span class="p">:</span>
<span class="nt">MAILNAME</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">somename.your-domain.com</span>
<span class="nt">TLS_KEY</span><span class="p">:</span> <span class="s">&quot;/etc/ssl/domains/your-domain.com/your-domain.com.key&quot;</span>
<span class="nt">TLS_CRT</span><span class="p">:</span> <span class="s">&quot;/etc/ssl/domains/your-domain.com/your-domain.com.crt&quot;</span>
<span class="nt">TLS_CA</span><span class="p">:</span> <span class="s">&quot;/etc/ssl/domains/your-domain.com/intermediate.crt&quot;</span>
<span class="nt">volumes</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/etc/ssl/domains/your-domain.com/:/etc/ssl/domains/your-domain.com/:ro</span>
<span class="nt">networks</span><span class="p">:</span>
<span class="nt">watchtower</span><span class="p">:</span>
<span class="c1"># this alias is really important to make your certificate work</span>
<span class="nt">aliases</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">smtp.your-domain.com</span>
<span class="nt">networks</span><span class="p">:</span>
<span class="nt">watchtower</span><span class="p">:</span>
<span class="nt">external</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">false</span>
</code></pre></div>
<h3 id="slack">Slack<a class="headerlink" href="#slack" title="Permanent link">&para;</a></h3>
<p>If watchtower is monitoring the same Docker daemon under which the watchtower container itself is running (i.e. if you volume-mounted <em>/var/run/docker.sock</em> into the watchtower container) then it has the ability to update itself. If a new version of the <em>containrrr/watchtower</em> image is pushed to the Docker Hub, your watchtower will pull down the new image and restart itself automatically.</p>
@ -623,42 +628,42 @@ networks:
<li><code>--notification-slack-icon-url</code> (env. <code>WATCHTOWER_NOTIFICATION_SLACK_ICON_URL</code>): An icon image URL string to use in place of the default icon.</li>
</ul>
<p>Example:</p>
<pre><code class="bash">docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
-e WATCHTOWER_NOTIFICATIONS=slack \
-e WATCHTOWER_NOTIFICATION_SLACK_HOOK_URL=&quot;https://hooks.slack.com/services/xxx/yyyyyyyyyyyyyyy&quot; \
-e WATCHTOWER_NOTIFICATION_SLACK_IDENTIFIER=watchtower-server-1 \
-e WATCHTOWER_NOTIFICATION_SLACK_CHANNEL=#my-custom-channel \
-e WATCHTOWER_NOTIFICATION_SLACK_ICON_EMOJI=:whale: \
-e WATCHTOWER_NOTIFICATION_SLACK_ICON_URL=&lt;icon url&gt; \
<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>
-e <span class="nv">WATCHTOWER_NOTIFICATIONS</span><span class="o">=</span>slack <span class="se">\</span>
-e <span class="nv">WATCHTOWER_NOTIFICATION_SLACK_HOOK_URL</span><span class="o">=</span><span class="s2">&quot;https://hooks.slack.com/services/xxx/yyyyyyyyyyyyyyy&quot;</span> <span class="se">\</span>
-e <span class="nv">WATCHTOWER_NOTIFICATION_SLACK_IDENTIFIER</span><span class="o">=</span>watchtower-server-1 <span class="se">\</span>
-e <span class="nv">WATCHTOWER_NOTIFICATION_SLACK_CHANNEL</span><span class="o">=</span><span class="c1">#my-custom-channel \</span>
-e <span class="nv">WATCHTOWER_NOTIFICATION_SLACK_ICON_EMOJI</span><span class="o">=</span>:whale: <span class="se">\</span>
-e <span class="nv">WATCHTOWER_NOTIFICATION_SLACK_ICON_URL</span><span class="o">=</span>&lt;icon url&gt; <span class="se">\</span>
containrrr/watchtower
</code></pre>
</code></pre></div>
<h3 id="microsoft_teams">Microsoft Teams<a class="headerlink" href="#microsoft_teams" title="Permanent link">&para;</a></h3>
<p>To receive notifications in MSTeams channel, add <code>msteams</code> to the <code>--notifications</code> option or the <code>WATCHTOWER_NOTIFICATIONS</code> environment variable.</p>
<p>Additionally, you should set the MSTeams webhook URL using the <code>--notification-msteams-hook</code> option or the <code>WATCHTOWER_NOTIFICATION_MSTEAMS_HOOK_URL</code> environment variable. This option can also reference a file, in which case the contents of the file are used.</p>
<p>MSTeams notifier could send keys/values filled by <code>log.WithField</code> or <code>log.WithFields</code> as MSTeams message facts. To enable this feature add <code>--notification-msteams-data</code> flag or set <code>WATCHTOWER_NOTIFICATION_MSTEAMS_USE_LOG_DATA=true</code> environment variable.</p>
<p>Example:</p>
<pre><code class="bash">docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
-e WATCHTOWER_NOTIFICATIONS=msteams \
-e WATCHTOWER_NOTIFICATION_MSTEAMS_HOOK_URL=&quot;https://outlook.office.com/webhook/xxxxxxxx@xxxxxxx/IncomingWebhook/yyyyyyyy/zzzzzzzzzz&quot; \
-e WATCHTOWER_NOTIFICATION_MSTEAMS_USE_LOG_DATA=true \
<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>
-e <span class="nv">WATCHTOWER_NOTIFICATIONS</span><span class="o">=</span>msteams <span class="se">\</span>
-e <span class="nv">WATCHTOWER_NOTIFICATION_MSTEAMS_HOOK_URL</span><span class="o">=</span><span class="s2">&quot;https://outlook.office.com/webhook/xxxxxxxx@xxxxxxx/IncomingWebhook/yyyyyyyy/zzzzzzzzzz&quot;</span> <span class="se">\</span>
-e <span class="nv">WATCHTOWER_NOTIFICATION_MSTEAMS_USE_LOG_DATA</span><span class="o">=</span><span class="nb">true</span> <span class="se">\</span>
containrrr/watchtower
</code></pre>
</code></pre></div>
<h3 id="gotify">Gotify<a class="headerlink" href="#gotify" title="Permanent link">&para;</a></h3>
<p>To push a notification to your Gotify instance, register a Gotify app and specify the Gotify URL and app token:</p>
<pre><code class="bash">docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
-e WATCHTOWER_NOTIFICATIONS=gotify \
-e WATCHTOWER_NOTIFICATION_GOTIFY_URL=&quot;https://my.gotify.tld/&quot; \
-e WATCHTOWER_NOTIFICATION_GOTIFY_TOKEN=&quot;SuperSecretToken&quot; \
<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>
-e <span class="nv">WATCHTOWER_NOTIFICATIONS</span><span class="o">=</span>gotify <span class="se">\</span>
-e <span class="nv">WATCHTOWER_NOTIFICATION_GOTIFY_URL</span><span class="o">=</span><span class="s2">&quot;https://my.gotify.tld/&quot;</span> <span class="se">\</span>
-e <span class="nv">WATCHTOWER_NOTIFICATION_GOTIFY_TOKEN</span><span class="o">=</span><span class="s2">&quot;SuperSecretToken&quot;</span> <span class="se">\</span>
containrrr/watchtower
</code></pre>
</code></pre></div>
<p><code>-e WATCHTOWER_NOTIFICATION_GOTIFY_TOKEN</code> or <code>--notification-gotify-token</code> can also reference a file, in which case the contents of the file are used.</p>
<p>If you want to disable TLS verification for the Gotify instance, you can use either <code>-e WATCHTOWER_NOTIFICATION_GOTIFY_TLS_SKIP_VERIFY=true</code> or <code>--notification-gotify-tls-skip-verify</code>. </p>
@ -676,14 +681,14 @@ You can define multiple services by space separating the URLs. (See example belo
<p>The template is a Go <a href="https://golang.org/pkg/text/template/">template</a> and the you format a list of <a href="https://pkg.go.dev/github.com/sirupsen/logrus?tab=doc#Entry">log entries</a>.</p>
<p>The default value if not set is <code>{{range .}}{{.Message}}{{println}}{{end}}</code>. The example below uses a template that also outputs timestamp and log level.</p>
<p>Example:</p>
<pre><code class="bash">docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
-e WATCHTOWER_NOTIFICATIONS=shoutrrr \
-e WATCHTOWER_NOTIFICATION_URL=&quot;discord://token@channel slack://watchtower@token-a/token-b/token-c&quot; \
-e WATCHTOWER_NOTIFICATION_TEMPLATE=&quot;{{range .}}{{.Time.Format \&quot;2006-01-02 15:04:05\&quot;}} ({{.Level}}): {{.Message}}{{println}}{{end}}&quot; \
<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>
-e <span class="nv">WATCHTOWER_NOTIFICATIONS</span><span class="o">=</span>shoutrrr <span class="se">\</span>
-e <span class="nv">WATCHTOWER_NOTIFICATION_URL</span><span class="o">=</span><span class="s2">&quot;discord://token@channel slack://watchtower@token-a/token-b/token-c&quot;</span> <span class="se">\</span>
-e <span class="nv">WATCHTOWER_NOTIFICATION_TEMPLATE</span><span class="o">=</span><span class="s2">&quot;{{range .}}{{.Time.Format \&quot;2006-01-02 15:04:05\&quot;}} ({{.Level}}): {{.Message}}{{println}}{{end}}&quot;</span> <span class="se">\</span>
containrrr/watchtower
</code></pre>
</code></pre></div>
@ -702,7 +707,7 @@ You can define multiple services by space separating the URLs. (See example belo
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid" aria-label="Footer">
<a href="../arguments/" title="Arguments" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<a href="../arguments/" 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>
@ -717,7 +722,7 @@ You can define multiple services by space separating the URLs. (See example belo
</a>
<a href="../container-selection/" title="Container selection" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
<a href="../container-selection/" 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">
@ -750,8 +755,8 @@ You can define multiple services by space separating the URLs. (See example belo
</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({

@ -7,11 +7,12 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="http://containrrr.github.io/watchtower/private-registries/">
<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">
@ -67,12 +70,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">
@ -101,7 +105,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>
@ -152,12 +156,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
@ -184,7 +189,7 @@
<li class="md-nav__item">
<a href=".." title="Home" class="md-nav__link">
<a href=".." class="md-nav__link">
Home
</a>
</li>
@ -196,7 +201,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>
@ -208,7 +213,7 @@
<li class="md-nav__item">
<a href="../usage-overview/" title="Usage overview" class="md-nav__link">
<a href="../usage-overview/" class="md-nav__link">
Usage overview
</a>
</li>
@ -220,7 +225,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>
@ -232,7 +237,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>
@ -244,7 +249,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>
@ -264,7 +269,7 @@
<a href="./" title="Private registries" class="md-nav__link md-nav__link--active">
<a href="./" class="md-nav__link md-nav__link--active">
Private registries
</a>
@ -277,7 +282,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>
@ -289,7 +294,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>
@ -301,7 +306,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>
@ -313,7 +318,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>
@ -325,7 +330,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>
@ -337,7 +342,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>
@ -387,20 +392,20 @@ There are two ways to generate this configuration file:</p>
<h3 id="create_the_configuration_file_manually">Create the configuration file manually<a class="headerlink" href="#create_the_configuration_file_manually" title="Permanent link">&para;</a></h3>
<p>Create a new configuration file with the following syntax and a base64 encoded username and
password <code>auth</code> string:</p>
<pre><code class="json">{
&quot;auths&quot;: {
&quot;&lt;REGISTRY_NAME&gt;&quot;: {
&quot;auth&quot;: &quot;XXXXXXX&quot;
}
}
}
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="p">{</span>
<span class="nt">&quot;auths&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;&lt;REGISTRY_NAME&gt;&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="nt">&quot;auth&quot;</span><span class="p">:</span> <span class="s2">&quot;XXXXXXX&quot;</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="p">}</span>
</code></pre></div>
<p><code>&lt;REGISTRY_NAME&gt;</code> needs to be replaced by the name of your private registry
(e.g., <code>my-private-registry.example.org</code>)</p>
<p>The required <code>auth</code> string can be generated as follows:</p>
<pre><code class="bash">echo -n 'username:password' | base64
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="nb">echo</span> -n <span class="s1">&#39;username:password&#39;</span> <span class="p">|</span> base64
</code></pre></div>
<blockquote>
<h3 id="i_username_and_password_for_gcloud"> Username and Password for GCloud<a class="headerlink" href="#i_username_and_password_for_gcloud" title="Permanent link">&para;</a></h3>
@ -411,8 +416,8 @@ echo -n "_json_key:$(cat gcloudauth.json)" | base64 -w0</code>
When the watchtower Docker container is started, the created configuration file
(<code>&lt;PATH&gt;/config.json</code> in this example) needs to be passed to the container:</p>
</blockquote>
<pre><code class="bash">docker run [...] -v &lt;PATH&gt;/config.json:/config.json containrrr/watchtower
</code></pre>
<div class="codehilite"><pre><span></span><code>docker run <span class="o">[</span>...<span class="o">]</span> -v &lt;PATH&gt;/config.json:/config.json containrrr/watchtower
</code></pre></div>
<h3 id="share_the_docker_configuration_file">Share the Docker configuration file<a class="headerlink" href="#share_the_docker_configuration_file" title="Permanent link">&para;</a></h3>
<p>To pull an image from a private registry, <code>docker login</code> needs to be called first, to get access
@ -420,34 +425,34 @@ to the registry. The provided credentials are stored in a configuration file cal
This configuration file can be directly used by watchtower. In this case, the creation of an
additional configuration file is not necessary.</p>
<p>When the Docker container is started, pass the configuration file to watchtower:</p>
<pre><code class="bash">docker run [...] -v &lt;PATH_TO_HOME_DIR&gt;/.docker/config.json:/config.json containrrr/watchtower
</code></pre>
<div class="codehilite"><pre><span></span><code>docker run <span class="o">[</span>...<span class="o">]</span> -v &lt;PATH_TO_HOME_DIR&gt;/.docker/config.json:/config.json containrrr/watchtower
</code></pre></div>
<p>When creating the watchtower container via docker-compose, use the following lines:</p>
<pre><code class="yaml">version: &quot;3.4&quot;
services:
watchtower:
image: index.docker.io/containrrr/watchtower:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- &lt;PATH_TO_HOME_DIR&gt;/.docker/config.json:/config.json
...
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="nt">version</span><span class="p">:</span> <span class="s">&quot;3.4&quot;</span>
<span class="nt">services</span><span class="p">:</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">index.docker.io/containrrr/watchtower:latest</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">&lt;PATH_TO_HOME_DIR&gt;/.docker/config.json:/config.json</span>
<span class="l l-Scalar l-Scalar-Plain">...</span>
</code></pre></div>
<h4 id="docker_config_path">Docker Config path<a class="headerlink" href="#docker_config_path" title="Permanent link">&para;</a></h4>
<p>By default, watchtower will look for the <code>config.json</code> file in <code>/</code>, but this can be changed by setting the <code>DOCKER_CONFIG</code> environment variable to the directory path where your config is located. This is useful for setups where the config.json file is changed while the watchtower instance is running, as the changes will not be picked up for a mounted file if the inode changes.
Example usage:</p>
<pre><code class="yaml">version: &quot;3.4&quot;
services:
watchtower:
image: containrrr/watchtower
environment:
DOCKER_CONFIG: /config
volumes:
- /etc/watchtower/config/:/config/
- /var/run/docker.sock:/var/run/docker.sock
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="nt">version</span><span class="p">:</span> <span class="s">&quot;3.4&quot;</span>
<span class="nt">services</span><span class="p">:</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">environment</span><span class="p">:</span>
<span class="nt">DOCKER_CONFIG</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">/config</span>
<span class="nt">volumes</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/etc/watchtower/config/:/config/</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/var/run/docker.sock:/var/run/docker.sock</span>
</code></pre></div>
<h2 id="credential_helpers">Credential helpers<a class="headerlink" href="#credential_helpers" title="Permanent link">&para;</a></h2>
<p>Some private Docker registries (the most prominent probably being AWS ECR) use non-standard ways of authentication.
@ -461,21 +466,21 @@ in a volume that may be mounted onto your watchtower container.</p>
<ol>
<li>Create the Dockerfile (contents below): </li>
</ol>
<pre><code class="Dockerfile">FROM golang:latest
<div class="codehilite"><pre><span></span><code><span class="k">FROM</span> <span class="s">golang:latest</span>
ENV CGO_ENABLED 0
ENV REPO github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login
<span class="k">ENV</span> CGO_ENABLED <span class="m">0</span>
<span class="k">ENV</span> REPO github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login
RUN go get -u $REPO
<span class="k">RUN</span> go get -u <span class="nv">$REPO</span>
RUN rm /go/bin/docker-credential-ecr-login
<span class="k">RUN</span> rm /go/bin/docker-credential-ecr-login
RUN go build \
-o /go/bin/docker-credential-ecr-login \
/go/src/$REPO
<span class="k">RUN</span> go build <span class="se">\</span>
-o /go/bin/docker-credential-ecr-login <span class="se">\</span>
/go/src/<span class="nv">$REPO</span>
WORKDIR /go/bin/
</code></pre>
<span class="k">WORKDIR</span><span class="s"> /go/bin/</span>
</code></pre></div>
<ol>
<li>Use the following commands to build the aws-ecr-dock-cred-helper and store it's output in a volume:</li>
@ -487,47 +492,46 @@ WORKDIR /go/bin/
<p>docker build -t aws-ecr-dock-cred-helper .</p>
<h1 id="build_the_command_and_store_it_in_the_new_volume_in_the_gobin_directory">Build the command and store it in the new volume in the /go/bin directory.<a class="headerlink" href="#build_the_command_and_store_it_in_the_new_volume_in_the_gobin_directory" title="Permanent link">&para;</a></h1>
<p>docker run -d --rm --name aws-cred-helper --volume helper:/go/bin aws-ecr-dock-cred-helper</p>
<pre><code>
3. Create a configuration file for docker, and store it in $HOME/.docker/config.json (replace the &lt;AWS_ACCOUNT_ID&gt;
placeholders with your AWS Account ID):
```json
{
&quot;credsStore&quot; : &quot;ecr-login&quot;,
&quot;HttpHeaders&quot; : {
&quot;User-Agent&quot; : &quot;Docker-Client/19.03.1 (XXXXXX)&quot;
},
&quot;auths&quot; : {
&quot;&lt;AWS_ACCOUNT_ID&gt;.dkr.ecr.us-west-1.amazonaws.com&quot; : {}
},
&quot;credHelpers&quot;: {
&quot;&lt;AWS_ACCOUNT_ID&gt;.dkr.ecr.us-west-1.amazonaws.com&quot; : &quot;ecr-login&quot;
}
}
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="mi">3</span><span class="p">.</span> <span class="k">Create</span> <span class="n">a</span> <span class="n">configuration</span> <span class="n">file</span> <span class="k">for</span> <span class="n">docker</span><span class="p">,</span> <span class="k">and</span> <span class="n">store</span> <span class="n">it</span> <span class="k">in</span> <span class="err">$</span><span class="n">HOME</span><span class="o">/</span><span class="p">.</span><span class="n">docker</span><span class="o">/</span><span class="n">config</span><span class="p">.</span><span class="n">json</span> <span class="p">(</span><span class="k">replace</span> <span class="n">the</span> <span class="o">&lt;</span><span class="n">AWS_ACCOUNT_ID</span><span class="o">&gt;</span>
<span class="n">placeholders</span> <span class="k">with</span> <span class="n">your</span> <span class="n">AWS</span> <span class="n">Account</span> <span class="n">ID</span><span class="p">):</span>
<span class="o">```</span><span class="n">json</span>
<span class="err">{</span>
<span class="ss">&quot;credsStore&quot;</span> <span class="p">:</span> <span class="ss">&quot;ecr-login&quot;</span><span class="p">,</span>
<span class="ss">&quot;HttpHeaders&quot;</span> <span class="p">:</span> <span class="err">{</span>
<span class="ss">&quot;User-Agent&quot;</span> <span class="p">:</span> <span class="ss">&quot;Docker-Client/19.03.1 (XXXXXX)&quot;</span>
<span class="err">}</span><span class="p">,</span>
<span class="ss">&quot;auths&quot;</span> <span class="p">:</span> <span class="err">{</span>
<span class="ss">&quot;&lt;AWS_ACCOUNT_ID&gt;.dkr.ecr.us-west-1.amazonaws.com&quot;</span> <span class="p">:</span> <span class="err">{}</span>
<span class="err">}</span><span class="p">,</span>
<span class="ss">&quot;credHelpers&quot;</span><span class="p">:</span> <span class="err">{</span>
<span class="ss">&quot;&lt;AWS_ACCOUNT_ID&gt;.dkr.ecr.us-west-1.amazonaws.com&quot;</span> <span class="p">:</span> <span class="ss">&quot;ecr-login&quot;</span>
<span class="err">}</span>
<span class="err">}</span>
</code></pre></div>
<ol>
<li>Create a docker-compose file (as an example) to help launch the container:</li>
</ol>
<p>and the docker-compose definition:</p>
<pre><code class="yaml">version: &quot;3.4&quot;
services:
# Check for new images and restart things if a new image exists
# for any of our containers.
watchtower:
image: containrrr/watchtower:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- .docker/config.json:/config.json
- helper:/go/bin
environment:
- HOME=/
- PATH=$PATH:/go/bin
- AWS_REGION=us-west-1
volumes:
helper:
external: true
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="nt">version</span><span class="p">:</span> <span class="s">&quot;3.4&quot;</span>
<span class="nt">services</span><span class="p">:</span>
<span class="c1"># Check for new images and restart things if a new image exists</span>
<span class="c1"># for any of our containers.</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:latest</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">.docker/config.json:/config.json</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">helper:/go/bin</span>
<span class="nt">environment</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">HOME=/</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">PATH=$PATH:/go/bin</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">AWS_REGION=us-west-1</span>
<span class="nt">volumes</span><span class="p">:</span>
<span class="nt">helper</span><span class="p">:</span>
<span class="nt">external</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">true</span>
</code></pre></div>
<p>A few additional notes:</p>
<ol>
@ -558,7 +562,7 @@ volumes:
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid" aria-label="Footer">
<a href="../container-selection/" title="Container selection" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<a href="../container-selection/" 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>
@ -573,7 +577,7 @@ volumes:
</a>
<a href="../linked-containers/" title="Linked containers" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
<a href="../linked-containers/" 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">
@ -606,8 +610,8 @@ volumes:
</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({

@ -7,11 +7,12 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="http://containrrr.github.io/watchtower/remote-hosts/">
<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>
@ -203,7 +208,7 @@
<li class="md-nav__item">
<a href="../usage-overview/" title="Usage overview" class="md-nav__link">
<a href="../usage-overview/" class="md-nav__link">
Usage overview
</a>
</li>
@ -215,7 +220,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>
@ -227,7 +232,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>
@ -239,7 +244,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>
@ -251,7 +256,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>
@ -263,7 +268,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>
@ -281,7 +286,7 @@
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<a href="./" title="Remote hosts" class="md-nav__link md-nav__link--active">
<a href="./" class="md-nav__link md-nav__link--active">
Remote hosts
</a>
@ -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>
@ -356,17 +361,17 @@
<h1>Remote hosts</h1>
<p>By default, watchtower is set-up to monitor the local Docker daemon (the same daemon running the watchtower container itself). However, it is possible to configure watchtower to monitor a remote Docker endpoint. When starting the watchtower container you can specify a remote Docker endpoint with either the <code>--host</code> flag or the <code>DOCKER_HOST</code> environment variable:</p>
<pre><code class="bash">docker run -d \
--name watchtower \
containrrr/watchtower --host &quot;tcp://10.0.1.2:2375&quot;
</code></pre>
<div class="codehilite"><pre><span></span><code>docker run -d <span class="se">\</span>
--name watchtower <span class="se">\</span>
containrrr/watchtower --host <span class="s2">&quot;tcp://10.0.1.2:2375&quot;</span>
</code></pre></div>
<p>or</p>
<pre><code class="bash">docker run -d \
--name watchtower \
-e DOCKER_HOST=&quot;tcp://10.0.1.2:2375&quot; \
<div class="codehilite"><pre><span></span><code>docker run -d <span class="se">\</span>
--name watchtower <span class="se">\</span>
-e <span class="nv">DOCKER_HOST</span><span class="o">=</span><span class="s2">&quot;tcp://10.0.1.2:2375&quot;</span> <span class="se">\</span>
containrrr/watchtower
</code></pre>
</code></pre></div>
<p>Note in both of the examples above that it is unnecessary to mount the <em>/var/run/docker.sock</em> into the watchtower container.</p>
@ -387,7 +392,7 @@
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid" aria-label="Footer">
<a href="../linked-containers/" title="Linked containers" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<a href="../linked-containers/" 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>
@ -402,7 +407,7 @@
</a>
<a href="../secure-connections/" title="Secure connections" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
<a href="../secure-connections/" 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">
@ -435,8 +440,8 @@
</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({

@ -7,11 +7,12 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="http://containrrr.github.io/watchtower/running-multiple-instances/">
<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>
@ -203,7 +208,7 @@
<li class="md-nav__item">
<a href="../usage-overview/" title="Usage overview" class="md-nav__link">
<a href="../usage-overview/" class="md-nav__link">
Usage overview
</a>
</li>
@ -215,7 +220,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>
@ -227,7 +232,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>
@ -239,7 +244,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>
@ -251,7 +256,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>
@ -263,7 +268,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>
@ -275,7 +280,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>
@ -287,7 +292,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>
@ -299,7 +304,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>
@ -311,7 +316,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>
@ -329,7 +334,7 @@
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<a href="./" title="Running multiple instances" class="md-nav__link md-nav__link--active">
<a href="./" class="md-nav__link md-nav__link--active">
Running multiple instances
</a>
@ -361,22 +366,22 @@
- An instance without a scope will clean up other running instances, even if they have a defined scope;</p>
<p>To define an instance monitoring scope, use the <code>--scope</code> argument or the <code>WATCHTOWER_SCOPE</code> environment variable on startup and set the <em>com.centurylinklabs.watchtower.scope</em> label with the same value for the containers you want to include in this instance's scope (including the instance itself).</p>
<p>For example, in a Docker Compose config file:</p>
<pre><code class="json">version: '3'
services:
app-monitored-by-watchtower:
image: myapps/monitored-by-watchtower
labels:
- &quot;com.centurylinklabs.watchtower.scope=myscope&quot;
watchtower:
image: containrrr/watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --interval 30 --scope myscope
labels:
- &quot;com.centurylinklabs.watchtower.scope=myscope&quot;
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="nt">version</span><span class="p">:</span> <span class="s">&#39;3&#39;</span>
<span class="nt">services</span><span class="p">:</span>
<span class="nt">app-monitored-by-watchtower</span><span class="p">:</span>
<span class="nt">image</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">myapps/monitored-by-watchtower</span>
<span class="nt">labels</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="s">&quot;com.centurylinklabs.watchtower.scope=myscope&quot;</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="nt">command</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">--interval 30 --scope myscope</span>
<span class="nt">labels</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="s">&quot;com.centurylinklabs.watchtower.scope=myscope&quot;</span>
</code></pre></div>
@ -395,7 +400,7 @@ services:
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid" aria-label="Footer">
<a href="../lifecycle-hooks/" title="Lifecycle hooks" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<a href="../lifecycle-hooks/" 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>
@ -429,8 +434,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({

File diff suppressed because one or more lines are too long

@ -7,11 +7,12 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="http://containrrr.github.io/watchtower/secure-connections/">
<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>
@ -203,7 +208,7 @@
<li class="md-nav__item">
<a href="../usage-overview/" title="Usage overview" class="md-nav__link">
<a href="../usage-overview/" class="md-nav__link">
Usage overview
</a>
</li>
@ -215,7 +220,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>
@ -227,7 +232,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>
@ -239,7 +244,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>
@ -251,7 +256,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>
@ -263,7 +268,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>
@ -275,7 +280,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>
@ -293,7 +298,7 @@
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<a href="./" title="Secure connections" class="md-nav__link md-nav__link--active">
<a href="./" class="md-nav__link md-nav__link--active">
Secure connections
</a>
@ -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,13 +363,13 @@
<p>Watchtower is also capable of connecting to Docker endpoints which are protected by SSL/TLS. If you've used <em>docker-machine</em> to provision your remote Docker host, you simply need to volume mount the certificates generated by <em>docker-machine</em> into the watchtower container and optionally specify <code>--tlsverify</code> flag.</p>
<p>The <em>docker-machine</em> certificates for a particular host can be located by executing the <code>docker-machine env</code> command for the desired host (note the values for the <code>DOCKER_HOST</code> and <code>DOCKER_CERT_PATH</code> environment variables that are returned from this command). The directory containing the certificates for the remote host needs to be mounted into the watchtower container at <em>/etc/ssl/docker</em>.</p>
<p>With the certificates mounted into the watchtower container you need to specify the <code>--tlsverify</code> flag to enable verification of the certificate:</p>
<pre><code class="bash">docker run -d \
--name watchtower \
-e DOCKER_HOST=$DOCKER_HOST \
-e DOCKER_CERT_PATH=/etc/ssl/docker \
-v $DOCKER_CERT_PATH:/etc/ssl/docker \
<div class="codehilite"><pre><span></span><code>docker run -d <span class="se">\</span>
--name watchtower <span class="se">\</span>
-e <span class="nv">DOCKER_HOST</span><span class="o">=</span><span class="nv">$DOCKER_HOST</span> <span class="se">\</span>
-e <span class="nv">DOCKER_CERT_PATH</span><span class="o">=</span>/etc/ssl/docker <span class="se">\</span>
-v <span class="nv">$DOCKER_CERT_PATH</span>:/etc/ssl/docker <span class="se">\</span>
containrrr/watchtower --tlsverify
</code></pre>
</code></pre></div>
@ -383,7 +388,7 @@
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid" aria-label="Footer">
<a href="../remote-hosts/" title="Remote hosts" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<a href="../remote-hosts/" 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>
@ -398,7 +403,7 @@
</a>
<a href="../stop-signals/" title="Stop signals" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
<a href="../stop-signals/" 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">
@ -431,8 +436,8 @@
</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({

@ -1,55 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url>
<loc>http://containrrr.github.io/watchtower/</loc>
<lastmod>2020-10-03</lastmod>
<lastmod>2020-12-20</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>http://containrrr.github.io/watchtower/introduction/</loc>
<lastmod>2020-10-03</lastmod>
<lastmod>2020-12-20</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>http://containrrr.github.io/watchtower/usage-overview/</loc>
<lastmod>2020-10-03</lastmod>
<lastmod>2020-12-20</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>http://containrrr.github.io/watchtower/arguments/</loc>
<lastmod>2020-10-03</lastmod>
<lastmod>2020-12-20</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>http://containrrr.github.io/watchtower/notifications/</loc>
<lastmod>2020-10-03</lastmod>
<lastmod>2020-12-20</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>http://containrrr.github.io/watchtower/container-selection/</loc>
<lastmod>2020-10-03</lastmod>
<lastmod>2020-12-20</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>http://containrrr.github.io/watchtower/private-registries/</loc>
<lastmod>2020-10-03</lastmod>
<lastmod>2020-12-20</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>http://containrrr.github.io/watchtower/linked-containers/</loc>
<lastmod>2020-10-03</lastmod>
<lastmod>2020-12-20</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>http://containrrr.github.io/watchtower/remote-hosts/</loc>
<lastmod>2020-10-03</lastmod>
<lastmod>2020-12-20</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>http://containrrr.github.io/watchtower/secure-connections/</loc>
<lastmod>2020-10-03</lastmod>
<lastmod>2020-12-20</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>http://containrrr.github.io/watchtower/stop-signals/</loc>
<lastmod>2020-10-03</lastmod>
<lastmod>2020-12-20</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>http://containrrr.github.io/watchtower/lifecycle-hooks/</loc>
<lastmod>2020-10-03</lastmod>
<lastmod>2020-12-20</lastmod>
<changefreq>daily</changefreq>
</url><url>
<loc>http://containrrr.github.io/watchtower/running-multiple-instances/</loc>
<lastmod>2020-10-03</lastmod>
<lastmod>2020-12-20</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>

Binary file not shown.

@ -7,11 +7,12 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="http://containrrr.github.io/watchtower/stop-signals/">
<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>
@ -203,7 +208,7 @@
<li class="md-nav__item">
<a href="../usage-overview/" title="Usage overview" class="md-nav__link">
<a href="../usage-overview/" class="md-nav__link">
Usage overview
</a>
</li>
@ -215,7 +220,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>
@ -227,7 +232,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>
@ -239,7 +244,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>
@ -251,7 +256,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>
@ -263,7 +268,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>
@ -275,7 +280,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>
@ -287,7 +292,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>
@ -305,7 +310,7 @@
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<a href="./" title="Stop signals" class="md-nav__link md-nav__link--active">
<a href="./" class="md-nav__link md-nav__link--active">
Stop signals
</a>
@ -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,12 +363,12 @@
<p>When watchtower detects that a running container needs to be updated it will stop the container by sending it a SIGTERM signal.
If your container should be shutdown with a different signal you can communicate this to watchtower by setting a label named <em>com.centurylinklabs.watchtower.stop-signal</em> with the value of the desired signal.</p>
<p>This label can be coded directly into your image by using the <code>LABEL</code> instruction in your Dockerfile:</p>
<pre><code class="docker">LABEL com.centurylinklabs.watchtower.stop-signal=&quot;SIGHUP&quot;
</code></pre>
<div class="codehilite"><pre><span></span><code><span class="k">LABEL</span> com.centurylinklabs.watchtower.stop-signal<span class="o">=</span><span class="s2">&quot;SIGHUP&quot;</span>
</code></pre></div>
<p>Or, it can be specified as part of the <code>docker run</code> command line:</p>
<pre><code class="bash">docker run -d --label=com.centurylinklabs.watchtower.stop-signal=SIGHUP someimage
</code></pre>
<div class="codehilite"><pre><span></span><code>docker run -d --label<span class="o">=</span>com.centurylinklabs.watchtower.stop-signal<span class="o">=</span>SIGHUP someimage
</code></pre></div>
@ -382,7 +387,7 @@ If your container should be shutdown with a different signal you can communicate
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid" aria-label="Footer">
<a href="../secure-connections/" title="Secure connections" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<a href="../secure-connections/" 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>
@ -397,7 +402,7 @@ If your container should be shutdown with a different signal you can communicate
</a>
<a href="../lifecycle-hooks/" title="Lifecycle hooks" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
<a href="../lifecycle-hooks/" 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">
@ -430,8 +435,8 @@ If your container should be shutdown with a different signal you can communicate
</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({

@ -0,0 +1,16 @@
[data-md-color-scheme="containrrr"] {
--md-primary-fg-color: #406170;
--md-primary-fg-color--light:#acbfc7;
--md-primary-fg-color--dark: #003343;
--md-accent-fg-color: #003343;
--md-accent-fg-color--transparent: #00334310;
}
.md-header-nav__button.md-logo {
padding: 0;
}
.md-header-nav__button.md-logo img {
width: 1.6rem;
height: 1.6rem;
}

@ -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-&lt;tag&gt;</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/&lt;user&gt;/.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/&lt;user&gt;/.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: &quot;3&quot;
services:
cavo:
image: index.docker.io/&lt;org&gt;/&lt;image&gt;:&lt;tag&gt;
ports:
- &quot;443:3443&quot;
- &quot;80:3080&quot;
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">&quot;3&quot;</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/&lt;org&gt;/&lt;image&gt;:&lt;tag&gt;</span>
<span class="nt">ports</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="s">&quot;443:3443&quot;</span>
<span class="p p-Indicator">-</span> <span class="s">&quot;80:3080&quot;</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…
Cancel
Save