Skip to content

Commit 26dbc64

Browse files
authored
Documentation updates (#936)
* Update private-registries.md * docs: fix codecov branch * docs: clarify monitor and add head fail warning * docs: remove unsupported features * docs: add date format note and fix typo * docs: 🌈 * docs: fix auto-format errors and linting * docs: fix auto-format errors and linting
1 parent cc3ff5a commit 26dbc64

File tree

10 files changed

+212
-155
lines changed

10 files changed

+212
-155
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<br/><br/>
88

99
[![Circle CI](https://circleci.com/gh/containrrr/watchtower.svg?style=shield)](https://circleci.com/gh/containrrr/watchtower)
10-
[![codecov](https://codecov.io/gh/containrrr/watchtower/branch/master/graph/badge.svg?token=8pxWgB380Y)](https://codecov.io/gh/containrrr/watchtower)
10+
[![codecov](https://codecov.io/gh/containrrr/watchtower/branch/main/graph/badge.svg)](https://codecov.io/gh/containrrr/watchtower)
1111
[![GoDoc](https://godoc.org/github.com/containrrr/watchtower?status.svg)](https://godoc.org/github.com/containrrr/watchtower)
1212
[![Microbadger](https://images.microbadger.com/badges/image/containrrr/watchtower.svg)](https://microbadger.com/images/containrrr/watchtower)
1313
[![Go Report Card](https://goreportcard.com/badge/github.com/containrrr/watchtower)](https://goreportcard.com/report/github.com/containrrr/watchtower)

docs/arguments.md

Lines changed: 55 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ When no arguments are specified, watchtower will monitor all running containers.
3030
## Help
3131
Shows documentation about the supported flags.
3232

33-
```
33+
```text
3434
Argument: --help
3535
Environment Variable: N/A
3636
Type: N/A
@@ -41,7 +41,7 @@ Environment Variable: N/A
4141
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.
4242
To find out the right value, see [this list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), find your location and use the value in _TZ Database Name_, e.g _Europe/Rome_. The timezone can alternatively be set by volume mounting your hosts /etc/localtime file. `-v /etc/localtime:/etc/localtime:ro`
4343

44-
```
44+
```text
4545
Argument: N/A
4646
Environment Variable: TZ
4747
Type: String
@@ -51,7 +51,7 @@ Environment Variable: TZ
5151
## Cleanup
5252
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.
5353

54-
```
54+
```text
5555
Argument: --cleanup
5656
Environment Variable: WATCHTOWER_CLEANUP
5757
Type: Boolean
@@ -61,7 +61,7 @@ Environment Variable: WATCHTOWER_CLEANUP
6161
## Remove attached volumes
6262
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.
6363

64-
```
64+
```text
6565
Argument: --remove-volumes
6666
Environment Variable: WATCHTOWER_REMOVE_VOLUMES
6767
Type: Boolean
@@ -71,7 +71,7 @@ Environment Variable: WATCHTOWER_REMOVE_VOLUMES
7171
## Debug
7272
Enable debug mode with verbose logging.
7373

74-
```
74+
```text
7575
Argument: --debug, -d
7676
Environment Variable: WATCHTOWER_DEBUG
7777
Type: Boolean
@@ -81,7 +81,7 @@ Environment Variable: WATCHTOWER_DEBUG
8181
## Trace
8282
Enable trace mode with very verbose logging. Caution: exposes credentials!
8383

84-
```
84+
```text
8585
Argument: --trace
8686
Environment Variable: WATCHTOWER_TRACE
8787
Type: Boolean
@@ -91,7 +91,7 @@ Environment Variable: WATCHTOWER_TRACE
9191
## ANSI colors
9292
Disable ANSI color escape codes in log output.
9393

94-
```
94+
```text
9595
Argument: --no-color
9696
Environment Variable: NO_COLOR
9797
Type: Boolean
@@ -101,7 +101,7 @@ Environment Variable: NO_COLOR
101101
## Docker host
102102
Docker daemon socket to connect to. Can be pointed at a remote Docker host by specifying a TCP endpoint as "tcp://hostname:port".
103103

104-
```
104+
```text
105105
Argument: --host, -H
106106
Environment Variable: DOCKER_HOST
107107
Type: String
@@ -111,7 +111,7 @@ Environment Variable: DOCKER_HOST
111111
## Docker API version
112112
The API version to use by the Docker client for connecting to the Docker daemon. The minimum supported version is 1.24.
113113

114-
```
114+
```text
115115
Argument: --api-version, -a
116116
Environment Variable: DOCKER_API_VERSION
117117
Type: String
@@ -121,7 +121,7 @@ Environment Variable: DOCKER_API_VERSION
121121
## Include restarting
122122
Will also include restarting containers.
123123

124-
```
124+
```text
125125
Argument: --include-restarting
126126
Environment Variable: WATCHTOWER_INCLUDE_RESTARTING
127127
Type: Boolean
@@ -131,7 +131,7 @@ Environment Variable: WATCHTOWER_INCLUDE_RESTARTING
131131
## Include stopped
132132
Will also include created and exited containers.
133133

134-
```
134+
```text
135135
Argument: --include-stopped
136136
Environment Variable: WATCHTOWER_INCLUDE_STOPPED
137137
Type: Boolean
@@ -141,7 +141,7 @@ Environment Variable: WATCHTOWER_INCLUDE_STOPPED
141141
## Revive stopped
142142
Start any stopped containers that have had their image updated. This argument is only usable with the `--include-stopped` argument.
143143

144-
```
144+
```text
145145
Argument: --revive-stopped
146146
Environment Variable: WATCHTOWER_REVIVE_STOPPED
147147
Type: Boolean
@@ -151,7 +151,7 @@ Environment Variable: WATCHTOWER_REVIVE_STOPPED
151151
## Poll interval
152152
Poll interval (in seconds). This value controls how frequently watchtower will poll for new images. Either `--schedule` or a poll interval can be defined, but not both.
153153

154-
```
154+
```text
155155
Argument: --interval, -i
156156
Environment Variable: WATCHTOWER_POLL_INTERVAL
157157
Type: Integer
@@ -161,24 +161,28 @@ Environment Variable: WATCHTOWER_POLL_INTERVAL
161161
## Filter by enable label
162162
Update containers that have a `com.centurylinklabs.watchtower.enable` label set to true.
163163

164-
```
164+
```text
165165
Argument: --label-enable
166166
Environment Variable: WATCHTOWER_LABEL_ENABLE
167167
Type: Boolean
168168
Default: false
169169
```
170170

171171
## Filter by disable label
172-
**Do not** update containers that have `com.centurylinklabs.watchtower.enable` label set to false and no `--label-enable` argument is passed. Note that only one or the other (targeting by enable label) can be used at the same time to target containers.
172+
__Do not__ update containers that have `com.centurylinklabs.watchtower.enable` label set to false and
173+
no `--label-enable` argument is passed. Note that only one or the other (targeting by enable label) can be
174+
used at the same time to target containers.
173175

174176
## Without updating containers
175-
Will only monitor for new images, send notifications and invoke the [pre-check/post-check hooks](https://containrrr.dev/watchtower/lifecycle-hooks/), but will **not** update the containers.
177+
Will only monitor for new images, send notifications and invoke
178+
the [pre-check/post-check hooks](https://containrrr.dev/watchtower/lifecycle-hooks/), but will __not__ update the
179+
containers.
176180

177-
> **⚠️ Please note**
178-
>
179-
> Due to Docker API limitations the latest image will still be pulled from the registry.
181+
!!! note Due to Docker API limitations the latest image will still be pulled from the registry.
182+
The HEAD digest checks allows watchtower to skip pulling when there are no changes, but to know _what_ has changed it
183+
will still do a pull whenever the repository digest doesn't match the local image digest.
180184

181-
```
185+
```text
182186
Argument: --monitor-only
183187
Environment Variable: WATCHTOWER_MONITOR_ONLY
184188
Type: Boolean
@@ -190,7 +194,7 @@ Note that monitor-only can also be specified on a per-container basis with the `
190194
## Without restarting containers
191195
Do not restart containers after updating. This option can be useful when the start of the containers
192196
is managed by an external system such as systemd.
193-
```
197+
```text
194198
Argument: --no-restart
195199
Environment Variable: WATCHTOWER_NO_RESTART
196200
Type: Boolean
@@ -203,7 +207,7 @@ new images from the registry. Instead it will only monitor the local image cache
203207
Use this option if you are building new images directly on the Docker host without pushing
204208
them to a registry.
205209

206-
```
210+
```text
207211
Argument: --no-pull
208212
Environment Variable: WATCHTOWER_NO_PULL
209213
Type: Boolean
@@ -213,7 +217,7 @@ Environment Variable: WATCHTOWER_NO_PULL
213217
## Without sending a startup message
214218
Do not send a message after watchtower started. Otherwise there will be an info-level notification.
215219

216-
```
220+
```text
217221
Argument: --no-startup-message
218222
Environment Variable: WATCHTOWER_NO_STARTUP_MESSAGE
219223
Type: Boolean
@@ -223,17 +227,18 @@ Environment Variable: WATCHTOWER_NO_STARTUP_MESSAGE
223227
## Run once
224228
Run an update attempt against a container name list one time immediately and exit.
225229

226-
```
230+
```text
227231
Argument: --run-once
228232
Environment Variable: WATCHTOWER_RUN_ONCE
229233
Type: Boolean
230234
Default: false
231235
```
232236

233237
## HTTP API Mode
234-
Runs Watchtower in HTTP API mode, only allowing image updates to be triggered by an HTTP request. For details see [HTTP API](https://containrrr.github.io/watchtower/http-api-mode).
238+
Runs Watchtower in HTTP API mode, only allowing image updates to be triggered by an HTTP request.
239+
For details see [HTTP API](https://containrrr.github.io/watchtower/http-api-mode).
235240

236-
```
241+
```text
237242
Argument: --http-api-update
238243
Environment Variable: WATCHTOWER_HTTP_API
239244
Type: Boolean
@@ -243,17 +248,18 @@ Environment Variable: WATCHTOWER_HTTP_API
243248
## HTTP API Token
244249
Sets an authentication token to HTTP API requests.
245250

246-
```
251+
```text
247252
Argument: --http-api-token
248253
Environment Variable: WATCHTOWER_HTTP_API_TOKEN
249254
Type: String
250255
Default: -
251256
```
252257

253258
## Filter by scope
254-
Update containers that have a `com.centurylinklabs.watchtower.scope` label set with the same value as the given argument. This enables [running multiple instances](https://containrrr.github.io/watchtower/running-multiple-instances).
259+
Update containers that have a `com.centurylinklabs.watchtower.scope` label set with the same value as the given argument.
260+
This enables [running multiple instances](https://containrrr.github.io/watchtower/running-multiple-instances).
255261

256-
```
262+
```text
257263
Argument: --scope
258264
Environment Variable: WATCHTOWER_SCOPE
259265
Type: String
@@ -263,7 +269,7 @@ Environment Variable: WATCHTOWER_SCOPE
263269
## HTTP API Metrics
264270
Enables a metrics endpoint, exposing prometheus metrics via HTTP. See [Metrics](metrics.md) for details.
265271

266-
```
272+
```text
267273
Argument: --http-api-metrics
268274
Environment Variable: WATCHTOWER_HTTP_API_METRICS
269275
Type: Boolean
@@ -274,7 +280,7 @@ Environment Variable: WATCHTOWER_HTTP_API_METRICS
274280
[Cron expression](https://pkg.go.dev/github.com/robfig/[email protected]?tab=doc#hdr-CRON_Expression_Format) in 6 fields (rather than the traditional 5) which defines when and how often to check for new images. Either `--interval` or the schedule expression
275281
can be defined, but not both. An example: `--schedule "0 0 4 * * *"`
276282

277-
```
283+
```text
278284
Argument: --schedule, -s
279285
Environment Variable: WATCHTOWER_SCHEDULE
280286
Type: String
@@ -285,7 +291,7 @@ Environment Variable: WATCHTOWER_SCHEDULE
285291
Restart one image at time instead of stopping and starting all at once. Useful in conjunction with lifecycle hooks
286292
to implement zero-downtime deploy.
287293

288-
```
294+
```text
289295
Argument: --rolling-restart
290296
Environment Variable: WATCHTOWER_ROLLING_RESTART
291297
Type: Boolean
@@ -295,19 +301,33 @@ Environment Variable: WATCHTOWER_ROLLING_RESTART
295301
## Wait until timeout
296302
Timeout before the container is forcefully stopped. When set, this option will change the default (`10s`) wait time to the given value. An example: `--stop-timeout 30s` will set the timeout to 30 seconds.
297303

298-
```
304+
```text
299305
Argument: --stop-timeout
300306
Environment Variable: WATCHTOWER_TIMEOUT
301307
Type: Duration
302308
Default: 10s
303309
```
304310

305311
## TLS Verification
306-
Use TLS when connecting to the Docker socket and verify the server's certificate. See below for options used to configure notifications.
307312

308-
```
313+
Use TLS when connecting to the Docker socket and verify the server's certificate. See below for options used to
314+
configure notifications.
315+
316+
```text
309317
Argument: --tlsverify
310318
Environment Variable: DOCKER_TLS_VERIFY
311319
Type: Boolean
312320
Default: false
313321
```
322+
323+
## HEAD failure warnings
324+
325+
When to warn about HEAD pull requests failing. Auto means that it will warn when the registry is known to handle the
326+
requests and may rate limit pull requests (mainly docker.io).
327+
328+
```text
329+
Argument: --warn-on-head-failure
330+
Environment Variable: WATCHTOWER_WARN_ON_HEAD_FAILURE
331+
Possible values: always, auto, never
332+
Default: auto
333+
```

docs/index.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<img alt="Circle CI" src="https://circleci.com/gh/containrrr/watchtower.svg?style=shield" />
1313
</a>
1414
<a href="https://codecov.io/gh/containrrr/watchtower">
15-
<img alt="Codecov" src="https://codecov.io/gh/containrrr/watchtower/branch/master/graph/badge.svg?token=8pxWgB380Y">
15+
<img alt="Codecov" src="https://codecov.io/gh/containrrr/watchtower/branch/main/graph/badge.svg">
1616
</a>
1717
<a href="https://godoc.org/github.com/containrrr/watchtower">
1818
<img alt="GoDoc" src="https://godoc.org/github.com/containrrr/watchtower?status.svg" />
@@ -42,11 +42,21 @@
4242

4343
## Quick Start
4444

45-
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:
45+
With watchtower you can update the running version of your containerized app simply by pushing a new image to the Docker
46+
Hub or your own image registry. Watchtower will pull down your new image, gracefully shut down your existing container
47+
and restart it with the same options that were used when it was deployed initially. Run the watchtower container with
48+
the following command:
4649

50+
=== "docker run"
51+
```bash $ docker run -d \
52+
--name watchtower \
53+
-v /var/run/docker.sock:/var/run/docker.sock \
54+
containrrr/watchtower
4755
```
48-
$ docker run -d \
49-
--name watchtower \
50-
-v /var/run/docker.sock:/var/run/docker.sock \
51-
containrrr/watchtower
52-
```
56+
=== "docker-compose.yml"
57+
```yaml version: "3"
58+
services:
59+
watchtower:
60+
image: containrrr/watchtower volumes:
61+
- /var/run/docker.sock:/var/run/docker.sock
62+
```

docs/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ With watchtower you can update the running version of your containerized app sim
44

55
For example, let's say you were running watchtower along with an instance of _centurylink/wetty-cli_ image:
66

7-
```bash
7+
```text
88
$ docker ps
99
CONTAINER ID IMAGE STATUS PORTS NAMES
1010
967848166a45 centurylink/wetty-cli Up 10 minutes 0.0.0.0:8080->3000/tcp wetty

docs/lifecycle-hooks.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
## Executing commands before and after updating
22

3-
> **DO NOTE**: These are shell commands executed with `sh`, and therefore require the
4-
> container to provide the `sh` executable.
3+
!!! note
4+
These are shell commands executed with `sh`, and therefore require the container to provide the `sh`
5+
executable.
56

67
It is possible to execute _pre/post\-check_ and _pre/post\-update_ commands
78
**inside** every container updated by watchtower.
@@ -26,24 +27,21 @@ The commands are specified using docker container labels, the following are curr
2627
| Post Update | `com.centurylinklabs.watchtower.lifecycle.post-update` |
2728
| Post Check | `com.centurylinklabs.watchtower.lifecycle.post-check` |
2829

29-
These labels can be declared as instructions in a Dockerfile (with some example .sh files):
30+
These labels can be declared as instructions in a Dockerfile (with some example .sh files) or be specified as part of
31+
the `docker run` command line:
3032

31-
```docker
32-
LABEL com.centurylinklabs.watchtower.lifecycle.pre-check="/sync.sh"
33+
=== "Dockerfile"
34+
```docker LABEL com.centurylinklabs.watchtower.lifecycle.pre-check="/sync.sh"
3335
LABEL com.centurylinklabs.watchtower.lifecycle.pre-update="/dump-data.sh"
3436
LABEL com.centurylinklabs.watchtower.lifecycle.post-update="/restore-data.sh"
3537
LABEL com.centurylinklabs.watchtower.lifecycle.post-check="/send-heartbeat.sh"
3638
```
37-
38-
Or be specified as part of the `docker run` command line:
39-
40-
```bash
41-
docker run -d \
42-
--label=com.centurylinklabs.watchtower.lifecycle.pre-check="/sync.sh" \
43-
--label=com.centurylinklabs.watchtower.lifecycle.pre-update="/dump-data.sh" \
44-
--label=com.centurylinklabs.watchtower.lifecycle.post-update="/restore-data.sh" \
45-
someimage
46-
--label=com.centurylinklabs.watchtower.lifecycle.post-check="/send-heartbeat.sh" \
39+
=== "docker run"
40+
```bash docker run -d \
41+
--label=com.centurylinklabs.watchtower.lifecycle.pre-check="/sync.sh" \
42+
--label=com.centurylinklabs.watchtower.lifecycle.pre-update="/dump-data.sh" \
43+
--label=com.centurylinklabs.watchtower.lifecycle.post-update="/restore-data.sh" \
44+
someimage --label=com.centurylinklabs.watchtower.lifecycle.post-check="/send-heartbeat.sh" \
4745
```
4846

4947
### Timeouts

0 commit comments

Comments
 (0)