-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow java executable to bind to privileged ports #14
Conversation
mini-sample showcase with docker-compose available here: |
I wonder whether it would make sense to make this There's some discussion about allowing non- |
I just read the latest comments on that issue and realized that it may not be possible to do in general. |
It's my understanding that Docker does track these capabilities bits properly in the graph drivers, so this should be something we could set in the |
In my opinion, the notion of "privileged ports" is pretty outdated anyways. |
@tristan0x, what do you think of #20? |
(I totally missed/forgot that this was a PR 😮, and now that I look at your changes, I think that it might as well be baked into the image rather than just on run as long as the graph drivers handle it correctly 😄) |
Turns out AUFS doesn't handle this correctly. 😢 Mind updating your PR to use |
Oh ouch, even that won't work: $ docker run -it --rm logstash bash
root@0fb6599489df:/# setcap 'cap_net_bind_service=+ep' "$(readlink -f "$(which java)")"
Failed to set capabilities on file `/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java' (Invalid argument)
The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file |
This should work now on a more recent version of aufs. |
Hi @tianon |
@justincormack are you sure this is fixed in recent versions of AUFS? FROM debian:jessie
RUN setcap 'cap_net_bind_service=+ep' "$(readlink -f "$(which bash)")" I built the above
|
@tianon yes, I don't know why I thought that then. |
Unfortunately my other fix has been postponed, due to needing more changes in |
We're coming up on the 2 year anniversary of this PR -- I'm thinking maybe it's finally time to close it and wait for ambient capabilities to be implemented in Docker for handling privileged ports generically regardless of image? 😇 🙏 ❤️ |
Closing since this image is being deprecated.
|
The logstash container is not allowed to bind on privileged ports.
Logstash provides some inputs whose default ports are in the privileged range. At least imap and syslog.
To reproduce
Use case
I want application containers to forward their logs to a syslog server (default port 514). In reality, the syslog server is a logstash container with a syslog input configured.
I use
--link
to bind application containers with logstash container so that application containers can use theLOGSTASH_PORT_514_TCP_ADDR
environment variable to configure themself. Thus it requires logstash container to expose the 514 port.