Update documentation for Docker Compose.

This commit is contained in:
Dan Helfman 2022-06-12 16:21:33 -07:00
parent ee45455ac8
commit 63b2ad426b
1 changed files with 20 additions and 3 deletions

View File

@ -36,18 +36,30 @@ send a wake-on-lan packet to. It expects plain TCP requests, not HTTP.
### Running the service
```
```bash
$ sudo docker run --detach --name wake-on-lan-service --host network \
--env PORT=18888
witten/wake-on-lan-service
```
Or, with Docker Compose:
```
services:
wake-on-lan-service:
image: witten/wake-on-lan-service
restart: always
network_mode: host
environment:
PORT: 18888
```
### Using the service
From within another container running on a Docker bridge network (so, no need
to run on the host network), execute:
```
```bash
echo "00:00:0A:BB:28:FC" | nc -N host.docker.internal 18888
```
@ -57,7 +69,12 @@ host.
For this to work, you may need to configure your client container to support
the special `host.docker.internal` host. E.g., `docker run --add-host
host.docker.internal:host-gateway ...`
host.docker.internal:host-gateway ...`. Or, with Docker Compose:
```yaml
extra_hosts:
- "host.docker.internal:host-gateway"
```
Alternatively, on Linux, you can try using the IP `172.17.0.1`.