From ef8e1fc21be8aeef45d14eee97b2e5ff99d9929f Mon Sep 17 00:00:00 2001 From: Shizun Ge Date: Thu, 15 Jun 2023 23:28:18 -0700 Subject: [PATCH] add faq section. describe how to bind to privileged ports in docker. --- examples/README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/README.md b/examples/README.md index 50c95f1..0826c30 100644 --- a/examples/README.md +++ b/examples/README.md @@ -10,10 +10,9 @@ An example how to setup endlessh-go, Prometheus, and Grafana using [docker compo An example how to setup endlessh-go with the Maxmind GeoIP Database. -### Using privileged ports (<1024) on docker +## FAQ +### Bind to privileged ports (<1024) in a container -If you want to run the image with privileged ports (below 1025), you need to set the container user to root: +You need to add capability `NET_BIND_SERVICE` to the program. -```yml -user: root -``` +If you are using docker, this can be done via cli argument [`--cap-add`](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities) or [`cap_add`](https://docs.docker.com/compose/compose-file/compose-file-v3/#cap_add-cap_drop) in the docker compose file.