1
0
mirror of https://github.com/containrrr/watchtower.git synced 2024-12-12 09:04:17 +02:00

Update HTTP API docs (#827)

This commit is contained in:
Lion - dapplion 2021-02-28 19:29:18 +01:00 committed by GitHub
parent 52e6e11395
commit f10b4e3492
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,7 @@ Watchtower provides an HTTP API mode that enables an HTTP endpoint that can be r
---
To enable this mode, use the flag `--http-api`. For example, in a Docker Compose config file:
To enable this mode, use the flag `--http-api-update`. For example, in a Docker Compose config file:
```yaml
version: '3'
@ -19,7 +19,7 @@ services:
image: containrrr/watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
command: --debug --http-api
command: --debug --http-api-update
environment:
- WATCHTOWER_HTTP_API_TOKEN=mytoken
labels:
@ -31,5 +31,5 @@ services:
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 `curl` command would trigger an image update:
```bash
curl -H "Token: mytoken" localhost:8080/v1/update
```
curl -H "Authorization: Bearer mytoken" localhost:8080/v1/update
```