From 63b2ad426baed3755937f07243b59965ebb08ba2 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Sun, 12 Jun 2022 16:21:33 -0700 Subject: [PATCH] Update documentation for Docker Compose. --- README.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6749448..c4e118b 100644 --- a/README.md +++ b/README.md @@ -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`.