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><codeclass="bash">$ docker run -d \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower \
nginx redis
</code></pre>
<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 a run-once flag and remove
the watchtower container after it's execution.</p>
<pre><codeclass="bash">$ docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower \
--run-once \
nginx redis
</code></pre>
<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 "--rm" flag.</p>
<p>When no arguments are specified, watchtower will monitor all running containers.</p>
<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>
<p>Will only monitor for new images, not update the containers.</p>
<pre><code> Argument: --monitor-only
Environment Variable: WATCHTOWER_MONITOR_ONLY
Type: Boolean
Default: false
</code></pre>
<h2id="without_pulling_new_images">Without pulling new images<aclass="headerlink"href="#without_pulling_new_images"title="Permanent link">¶</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
<p><ahref="https://godoc.org/github.com/robfig/cron#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 could 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>
<h2id="wait_until_timeout">Wait until timeout<aclass="headerlink"href="#wait_until_timeout"title="Permanent link">¶</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>