Official Caddy image causes: exec /usr/bin/caddy: operation not permitted

When deploying the Docker image caddy:latest, you get:

==> Starting service...
exec /usr/bin/caddy: operation not permitted
exec /usr/bin/caddy: operation not permitted
==> Exited with status 1
==> Common ways to troubleshoot your deploy: https://render.com/docs/troubleshooting-deploys

This error has come up here in the forum, but it was never resolved. What’s causing this and how to fix it? The image has no issues when running on DigitalOcean Apps.

Support provided the solution: Adding RUN setcap -r /usr/bin/caddy in a custom Dockerfile that builds on top of caddy resolved this. This removes the capabilities to bind to lower ports such as 80 or 443.

1 Like