You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
watchtower/arguments/index.html

1192 lines
38 KiB
HTML

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="http://containrrr.github.io/watchtower/arguments/">
<link rel="icon" href="../images/favicon.ico">
<meta name="generator" content="mkdocs-1.1.2, mkdocs-material-7.1.3">
<title>Arguments - Watchtower</title>
<link rel="stylesheet" href="../assets/stylesheets/main.e35208c4.min.css">
<link rel="stylesheet" href="../assets/stylesheets/palette.ef6f36e2.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>:root{--md-text-font-family:"Roboto";--md-code-font-family:"Roboto Mono"}</style>
<link rel="stylesheet" href="../stylesheets/theme.css">
</head>
<body dir="ltr" data-md-color-scheme="containrrr" data-md-color-primary="" data-md-color-accent="">
<script>function __prefix(e){return new URL("..",location).pathname+"."+e}function __get(e,t=localStorage){return JSON.parse(t.getItem(__prefix(e)))}</script>
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#help" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href=".." title="Watchtower" class="md-header__button md-logo" aria-label="Watchtower" data-md-component="logo">
<img src="../images/logo-450px.png" alt="logo">
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
Watchtower
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Arguments
</span>
</div>
</div>
</div>
<label class="md-header__button 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 0 1 16 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 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<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" 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 0 1 16 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 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.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>
</label>
<button type="reset" class="md-search__icon md-icon" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
</button>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list"></ol>
</div>
</div>
</div>
</div>
</div>
<div class="md-header__source">
<a href="https://github.com/containrrr/watchtower/" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
</div>
<div class="md-source__repository">
GitHub
</div>
</a>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="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">
<label class="md-nav__title" for="__drawer">
<a href=".." title="Watchtower" class="md-nav__button md-logo" aria-label="Watchtower" data-md-component="logo">
<img src="../images/logo-450px.png" alt="logo">
</a>
Watchtower
</label>
<div class="md-nav__source">
<a href="https://github.com/containrrr/watchtower/" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
</div>
<div class="md-source__repository">
GitHub
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href=".." class="md-nav__link">
Home
</a>
</li>
<li class="md-nav__item">
<a href="../introduction/" class="md-nav__link">
Introduction
</a>
</li>
<li class="md-nav__item">
<a href="../usage-overview/" class="md-nav__link">
Usage overview
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
Arguments
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
Arguments
</a>
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#help" class="md-nav__link">
Help
</a>
</li>
<li class="md-nav__item">
<a href="#time_zone" class="md-nav__link">
Time Zone
</a>
</li>
<li class="md-nav__item">
<a href="#cleanup" class="md-nav__link">
Cleanup
</a>
</li>
<li class="md-nav__item">
<a href="#remove_attached_volumes" class="md-nav__link">
Remove attached volumes
</a>
</li>
<li class="md-nav__item">
<a href="#debug" class="md-nav__link">
Debug
</a>
</li>
<li class="md-nav__item">
<a href="#trace" class="md-nav__link">
Trace
</a>
</li>
<li class="md-nav__item">
<a href="#ansi_colors" class="md-nav__link">
ANSI colors
</a>
</li>
<li class="md-nav__item">
<a href="#docker_host" class="md-nav__link">
Docker host
</a>
</li>
<li class="md-nav__item">
<a href="#docker_api_version" class="md-nav__link">
Docker API version
</a>
</li>
<li class="md-nav__item">
<a href="#include_restarting" class="md-nav__link">
Include restarting
</a>
</li>
<li class="md-nav__item">
<a href="#include_stopped" class="md-nav__link">
Include stopped
</a>
</li>
<li class="md-nav__item">
<a href="#revive_stopped" class="md-nav__link">
Revive stopped
</a>
</li>
<li class="md-nav__item">
<a href="#poll_interval" class="md-nav__link">
Poll interval
</a>
</li>
<li class="md-nav__item">
<a href="#filter_by_enable_label" class="md-nav__link">
Filter by enable label
</a>
</li>
<li class="md-nav__item">
<a href="#filter_by_disable_label" class="md-nav__link">
Filter by disable label
</a>
</li>
<li class="md-nav__item">
<a href="#without_updating_containers" class="md-nav__link">
Without updating containers
</a>
</li>
<li class="md-nav__item">
<a href="#without_restarting_containers" class="md-nav__link">
Without restarting containers
</a>
</li>
<li class="md-nav__item">
<a href="#without_pulling_new_images" class="md-nav__link">
Without pulling new images
</a>
</li>
<li class="md-nav__item">
<a href="#without_sending_a_startup_message" class="md-nav__link">
Without sending a startup message
</a>
</li>
<li class="md-nav__item">
<a href="#run_once" class="md-nav__link">
Run once
</a>
</li>
<li class="md-nav__item">
<a href="#http_api_mode" class="md-nav__link">
HTTP API Mode
</a>
</li>
<li class="md-nav__item">
<a href="#http_api_token" class="md-nav__link">
HTTP API Token
</a>
</li>
<li class="md-nav__item">
<a href="#filter_by_scope" class="md-nav__link">
Filter by scope
</a>
</li>
<li class="md-nav__item">
<a href="#http_api_metrics" class="md-nav__link">
HTTP API Metrics
</a>
</li>
<li class="md-nav__item">
<a href="#scheduling" class="md-nav__link">
Scheduling
</a>
</li>
<li class="md-nav__item">
<a href="#rolling_restart" class="md-nav__link">
Rolling restart
</a>
</li>
<li class="md-nav__item">
<a href="#wait_until_timeout" class="md-nav__link">
Wait until timeout
</a>
</li>
<li class="md-nav__item">
<a href="#tls_verification" class="md-nav__link">
TLS Verification
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../notifications/" class="md-nav__link">
Notifications
</a>
</li>
<li class="md-nav__item">
<a href="../container-selection/" class="md-nav__link">
Container selection
</a>
</li>
<li class="md-nav__item">
<a href="../private-registries/" class="md-nav__link">
Private registries
</a>
</li>
<li class="md-nav__item">
<a href="../linked-containers/" class="md-nav__link">
Linked containers
</a>
</li>
<li class="md-nav__item">
<a href="../remote-hosts/" class="md-nav__link">
Remote hosts
</a>
</li>
<li class="md-nav__item">
<a href="../secure-connections/" class="md-nav__link">
Secure connections
</a>
</li>
<li class="md-nav__item">
<a href="../stop-signals/" class="md-nav__link">
Stop signals
</a>
</li>
<li class="md-nav__item">
<a href="../lifecycle-hooks/" class="md-nav__link">
Lifecycle hooks
</a>
</li>
<li class="md-nav__item">
<a href="../running-multiple-instances/" class="md-nav__link">
Running multiple instances
</a>
</li>
<li class="md-nav__item">
<a href="../metrics/" class="md-nav__link">
Metrics
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#help" class="md-nav__link">
Help
</a>
</li>
<li class="md-nav__item">
<a href="#time_zone" class="md-nav__link">
Time Zone
</a>
</li>
<li class="md-nav__item">
<a href="#cleanup" class="md-nav__link">
Cleanup
</a>
</li>
<li class="md-nav__item">
<a href="#remove_attached_volumes" class="md-nav__link">
Remove attached volumes
</a>
</li>
<li class="md-nav__item">
<a href="#debug" class="md-nav__link">
Debug
</a>
</li>
<li class="md-nav__item">
<a href="#trace" class="md-nav__link">
Trace
</a>
</li>
<li class="md-nav__item">
<a href="#ansi_colors" class="md-nav__link">
ANSI colors
</a>
</li>
<li class="md-nav__item">
<a href="#docker_host" class="md-nav__link">
Docker host
</a>
</li>
<li class="md-nav__item">
<a href="#docker_api_version" class="md-nav__link">
Docker API version
</a>
</li>
<li class="md-nav__item">
<a href="#include_restarting" class="md-nav__link">
Include restarting
</a>
</li>
<li class="md-nav__item">
<a href="#include_stopped" class="md-nav__link">
Include stopped
</a>
</li>
<li class="md-nav__item">
<a href="#revive_stopped" class="md-nav__link">
Revive stopped
</a>
</li>
<li class="md-nav__item">
<a href="#poll_interval" class="md-nav__link">
Poll interval
</a>
</li>
<li class="md-nav__item">
<a href="#filter_by_enable_label" class="md-nav__link">
Filter by enable label
</a>
</li>
<li class="md-nav__item">
<a href="#filter_by_disable_label" class="md-nav__link">
Filter by disable label
</a>
</li>
<li class="md-nav__item">
<a href="#without_updating_containers" class="md-nav__link">
Without updating containers
</a>
</li>
<li class="md-nav__item">
<a href="#without_restarting_containers" class="md-nav__link">
Without restarting containers
</a>
</li>
<li class="md-nav__item">
<a href="#without_pulling_new_images" class="md-nav__link">
Without pulling new images
</a>
</li>
<li class="md-nav__item">
<a href="#without_sending_a_startup_message" class="md-nav__link">
Without sending a startup message
</a>
</li>
<li class="md-nav__item">
<a href="#run_once" class="md-nav__link">
Run once
</a>
</li>
<li class="md-nav__item">
<a href="#http_api_mode" class="md-nav__link">
HTTP API Mode
</a>
</li>
<li class="md-nav__item">
<a href="#http_api_token" class="md-nav__link">
HTTP API Token
</a>
</li>
<li class="md-nav__item">
<a href="#filter_by_scope" class="md-nav__link">
Filter by scope
</a>
</li>
<li class="md-nav__item">
<a href="#http_api_metrics" class="md-nav__link">
HTTP API Metrics
</a>
</li>
<li class="md-nav__item">
<a href="#scheduling" class="md-nav__link">
Scheduling
</a>
</li>
<li class="md-nav__item">
<a href="#rolling_restart" class="md-nav__link">
Rolling restart
</a>
</li>
<li class="md-nav__item">
<a href="#wait_until_timeout" class="md-nav__link">
Wait until timeout
</a>
</li>
<li class="md-nav__item">
<a href="#tls_verification" class="md-nav__link">
TLS Verification
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<a href="https://github.com/containrrr/watchtower/edit/main/docs/arguments.md" title="Edit this page" class="md-content__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>
</a>
<h1>Arguments</h1>
<p>By default, watchtower will monitor all containers running within the Docker daemon to which it is pointed (in most cases this
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>
<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></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>
<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></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>
<div class="codehilite"><pre><span></span><code> Argument: --help
Environment Variable: N/A
Type: N/A
Default: N/A
</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 timezone can alternatively be set by volume mounting your hosts /etc/localtime file. <code>-v /etc/localtime:/etc/localtime:ro</code></p>
<div class="codehilite"><pre><span></span><code> Argument: N/A
Environment Variable: TZ
Type: String
Default: &quot;UTC&quot;
</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>
<div class="codehilite"><pre><span></span><code> Argument: --cleanup
Environment Variable: WATCHTOWER_CLEANUP
Type: Boolean
Default: false
</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>
<div class="codehilite"><pre><span></span><code> Argument: --remove-volumes
Environment Variable: WATCHTOWER_REMOVE_VOLUMES
Type: Boolean
Default: false
</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>
<div class="codehilite"><pre><span></span><code> Argument: --debug, -d
Environment Variable: WATCHTOWER_DEBUG
Type: Boolean
Default: false
</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>
<div class="codehilite"><pre><span></span><code> Argument: --trace
Environment Variable: WATCHTOWER_TRACE
Type: Boolean
Default: false
</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>
<div class="codehilite"><pre><span></span><code> Argument: --no-color
Environment Variable: NO_COLOR
Type: Boolean
Default: false
</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>
<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>
<div class="codehilite"><pre><span></span><code> Argument: --api-version, -a
Environment Variable: DOCKER_API_VERSION
Type: String
Default: &quot;1.24&quot;
</code></pre></div>
<h2 id="include_restarting">Include restarting<a class="headerlink" href="#include_restarting" title="Permanent link">&para;</a></h2>
<p>Will also include restarting containers.</p>
<div class="codehilite"><pre><span></span><code> <span class="nv">Argument</span>: <span class="o">--</span><span class="k">include</span><span class="o">-</span><span class="nv">restarting</span>
<span class="nv">Environment</span> <span class="nv">Variable</span>: <span class="nv">WATCHTOWER_INCLUDE_RESTARTING</span>
<span class="nv">Type</span>: <span class="nv">Boolean</span>
<span class="nv">Default</span>: <span class="nv">false</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>
<div class="codehilite"><pre><span></span><code> <span class="nv">Argument</span>: <span class="o">--</span><span class="k">include</span><span class="o">-</span><span class="nv">stopped</span>
<span class="nv">Environment</span> <span class="nv">Variable</span>: <span class="nv">WATCHTOWER_INCLUDE_STOPPED</span>
<span class="nv">Type</span>: <span class="nv">Boolean</span>
<span class="nv">Default</span>: <span class="nv">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>
<div class="codehilite"><pre><span></span><code> Argument: --revive-stopped
Environment Variable: WATCHTOWER_REVIVE_STOPPED
Type: Boolean
Default: false
</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>
<div class="codehilite"><pre><span></span><code> Argument: --interval, -i
Environment Variable: WATCHTOWER_POLL_INTERVAL
Type: Integer
Default: 86400 (24 hours)
</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>
<div class="codehilite"><pre><span></span><code> Argument: --label-enable
Environment Variable: WATCHTOWER_LABEL_ENABLE
Type: Boolean
Default: false
</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>
<h2 id="without_updating_containers">Without updating containers<a class="headerlink" href="#without_updating_containers" title="Permanent link">&para;</a></h2>
<p>Will only monitor for new images, send notifications and invoke the <a href="https://containrrr.dev/watchtower/lifecycle-hooks/">pre-check/post-check hooks</a>, but will <strong>not</strong> update the containers.</p>
<blockquote>
<p><strong>⚠️ Please note</strong></p>
<p>Due to Docker API limitations the latest image will still be pulled from the registry.</p>
</blockquote>
<div class="codehilite"><pre><span></span><code> Argument: --monitor-only
Environment Variable: WATCHTOWER_MONITOR_ONLY
Type: Boolean
Default: false
</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>
<div class="codehilite"><pre><span></span><code> Argument: --no-restart
Environment Variable: WATCHTOWER_NO_RESTART
Type: Boolean
Default: false
</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>
<div class="codehilite"><pre><span></span><code> Argument: --no-pull
Environment Variable: WATCHTOWER_NO_PULL
Type: Boolean
Default: false
</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>
<div class="codehilite"><pre><span></span><code> Argument: --no-startup-message
Environment Variable: WATCHTOWER_NO_STARTUP_MESSAGE
Type: Boolean
Default: false
</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>
<div class="codehilite"><pre><span></span><code> Argument: --run-once
Environment Variable: WATCHTOWER_RUN_ONCE
Type: Boolean
Default: false
</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. For details see <a href="https://containrrr.github.io/watchtower/http-api-mode">HTTP API</a>.</p>
<div class="codehilite"><pre><span></span><code> Argument: --http-api-update
Environment Variable: WATCHTOWER_HTTP_API
Type: Boolean
Default: false
</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>
<div class="codehilite"><pre><span></span><code> Argument: --http-api-token
Environment Variable: WATCHTOWER_HTTP_API_TOKEN
Type: String
Default: -
</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>
<div class="codehilite"><pre><span></span><code> Argument: --scope
Environment Variable: WATCHTOWER_SCOPE
Type: String
Default: -
</code></pre></div>
<h2 id="http_api_metrics">HTTP API Metrics<a class="headerlink" href="#http_api_metrics" title="Permanent link">&para;</a></h2>
<p>Enables a metrics endpoint, exposing prometheus metrics via HTTP. See <a href="../metrics/">Metrics</a> for details. </p>
<div class="codehilite"><pre><span></span><code> Argument: --http-api-metrics
Environment Variable: WATCHTOWER_HTTP_API_METRICS
Type: Boolean
Default: false
</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>
<div class="codehilite"><pre><span></span><code> Argument: --schedule, -s
Environment Variable: WATCHTOWER_SCHEDULE
Type: String
Default: -
</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>
<div class="codehilite"><pre><span></span><code> Argument: --rolling-restart
Environment Variable: WATCHTOWER_ROLLING_RESTART
Type: Boolean
Default: false
</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>
<div class="codehilite"><pre><span></span><code> Argument: --stop-timeout
Environment Variable: WATCHTOWER_TIMEOUT
Type: Duration
Default: 10s
</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>
<div class="codehilite"><pre><span></span><code> Argument: --tlsverify
Environment Variable: DOCKER_TLS_VERIFY
Type: Boolean
Default: false
</code></pre></div>
</article>
</div>
</div>
</main>
<footer class="md-footer">
<nav class="md-footer__inner md-grid" aria-label="Footer">
<a href="../usage-overview/" class="md-footer__link md-footer__link--prev" rel="prev">
<div class="md-footer__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>
<div class="md-footer__title">
<div class="md-ellipsis">
<span class="md-footer__direction">
Previous
</span>
Usage overview
</div>
</div>
</a>
<a href="../notifications/" class="md-footer__link md-footer__link--next" rel="next">
<div class="md-footer__title">
<div class="md-ellipsis">
<span class="md-footer__direction">
Next
</span>
Notifications
</div>
</div>
<div class="md-footer__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
</div>
</a>
</nav>
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-footer-copyright">
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "..", "features": [], "translations": {"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"}, "search": "../assets/javascripts/workers/search.fe42c31b.min.js", "version": null}</script>
<script src="../assets/javascripts/bundle.4ea5477f.min.js"></script>
</body>
</html>