You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-10Lines changed: 28 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ With watchtower you can update the running version of your containerized app sim
13
13
14
14
For example, let's say you were running watchtower along with an instance of *centurylink/wetty-cli* image:
15
15
16
-
```
16
+
```bash
17
17
$ docker ps
18
18
CONTAINER ID IMAGE STATUS PORTS NAMES
19
19
967848166a45 centurylink/wetty-cli Up 10 minutes 0.0.0.0:8080->3000/tcp wetty
@@ -30,7 +30,7 @@ Since the watchtower code needs to interact with the Docker API in order to moni
30
30
31
31
Run the `watchtower` container with the following command:
32
32
33
-
```
33
+
```bash
34
34
docker run -d \
35
35
--name watchtower \
36
36
-v /var/run/docker.sock:/var/run/docker.sock \
@@ -40,19 +40,37 @@ docker run -d \
40
40
If pulling images from private Docker registries, supply registry authentication credentials with the environment variables `REPO_USER` and `REPO_PASS`
41
41
or by mounting the host's docker config file into the container (at the root of the container filesystem `/`).
If you mount the config file as described below, 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 dockerhub and monitors it with watchtower. Note the command argument changing the interval to 30s rather than the default 5 minutes.
52
+
53
+
```json
54
+
version: "3"
55
+
services:
56
+
cavo:
57
+
image: index.docker.io/<org>/<image>:<tag>
58
+
ports:
59
+
- "443:3443"
60
+
- "80:3080"
61
+
watchtower:
62
+
image: v2tec/watchtower
63
+
volumes:
64
+
- /var/run/docker.sock:/var/run/docker.sock
65
+
- /root/.docker/config.json:/config.json
66
+
command: --interval 30
67
+
```
68
+
51
69
### Arguments
52
70
53
71
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 `--host` 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.
54
72
55
-
```
73
+
```bash
56
74
docker run -d \
57
75
--name watchtower \
58
76
-v /var/run/docker.sock:/var/run/docker.sock \
@@ -67,7 +85,7 @@ When no arguments are specified, watchtower will monitor all running containers.
67
85
68
86
Any of the options described below can be passed to the watchtower process by setting them after the image name in the `docker run` string:
69
87
70
-
```
88
+
```bash
71
89
docker run --rm v2tec/watchtower --help
72
90
```
73
91
@@ -93,29 +111,29 @@ If your container should be shutdown with a different signal you can communicate
93
111
94
112
This label can be coded directly into your image by using the `LABEL` instruction in your Dockerfile:
Or, it can be specified as part of the `docker run` command line:
101
119
102
-
```
120
+
```bash
103
121
docker run -d --label=com.centurylinklabs.watchtower.stop-signal=SIGHUP someimage
104
122
```
105
123
106
124
## Remote Hosts
107
125
108
126
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 `--host` flag or the `DOCKER_HOST` environment variable:
109
127
110
-
```
128
+
```bash
111
129
docker run -d \
112
130
--name watchtower \
113
131
v2tec/watchtower --host "tcp://10.0.1.2:2375"
114
132
```
115
133
116
134
or
117
135
118
-
```
136
+
```bash
119
137
docker run -d \
120
138
--name watchtower \
121
139
-e DOCKER_HOST="tcp://10.0.1.2:2375" \
@@ -132,7 +150,7 @@ The *docker-machine* certificates for a particular host can be located by execut
132
150
133
151
With the certificates mounted into the watchtower container you need to specify the `--tlsverify` flag to enable verification of the certificate:
0 commit comments