Skip to content

Commit b198010

Browse files
committed
Added NET_BIND_SERVICE note
1 parent dbb5453 commit b198010

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

caddy/content.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ Giving the container this capability is optional and has potential, though unlik
121121

122122
See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for more details.
123123

124+
This image adds the `NET_BIND_SERVICE` capability to the Caddy executable, to allow a non-root user to bind to privileged ports (<1024) such as 80 and 443. If you're not using privileged ports and would like to drop the capability again, you can do so using `RUN setcap cap_net_bind_service=-ep /usr/bin/caddy`. This avoids the error `exec /usr/bin/caddy: operation not permitted` when the container process does not have the capability.
125+
124126
### Docker Compose example
125127

126128
If you prefer to use `docker compose` to run your stack, here's a sample service definition which goes in a file named `compose.yaml`. The configuration assumes you put a custom Caddyfile into `$PWD/conf` as described [above](#basic-usage).

0 commit comments

Comments
 (0)