-
Notifications
You must be signed in to change notification settings - Fork 832
Remove -only-exposed from docker-gen statement so that it will pick u… #230
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
Conversation
…p containers on internal networks
Have you tested it ? I just tested what you suggested (portainer on an internal network) in a variety of docker networks setup, none of them works with your PR, you end up with an empty I'm not sure of what you are trying to accomplish by putting a container supposed to provide an UI on an internal network that is unreachable from the outside. |
I have tested it, but this change would only affect the generation of the certs by the To get the Here's an example docker-compose file that works and might make more sense: https://gist.github.com/thmhoag/2e160cee99fb7c9f46db8e4a34c80d15 Of course to run it you'll have to change the image name of the The key for the
As far as what I'm trying to accomplish, you're right, it's a bit of an edge-case. The idea is simply to keep all containers that don't absolutely require outside internet access on an internal network, especially the containers that have access to the |
Correct me if I'm wrong, but if you want to proxy traffic to a container and have it accessible via a domain name (and a portainer container you can't reach has pretty much zero purpose), it no longer qualify as a container that don't require outside internet access. The two seems pretty contradictory to me. edit : oh I think I get it, you mean preventing those containers from reaching the outside world on their own accord, not the other way around ? |
Right, exactly. I'm intentionally exposing web traffic via the proxy, but that container doesn't need access to the internet to serve the purpose of providing a web UI for I think my question here would be, is there any reason that we need the |
True. I don't see any real necessity behind the argument either (beside the presumption that container without exposed ports won't require proxying anyway and thus don't need to be feeded to docker-gen, which prevents your use case). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--only-exposed
has already been removed from the docker-gen
process running on nginx-proxy and as @thmhoag pointed out the containers retrieved from Docker's API are filtered by LETSENCRYPT_HOST
anyway.
Remove the last remaining -only-exposed on /app/function.sh after #230
Remove
-only-exposed
from thedocker-gen
statement in order to allow theletsencrypt-companion
container to pickup containers that are in internal networks.Docker itself will not actually expose ports on containers that are in internal-only networks. This creates a problem when attempting to proxy web servers in containers that are on internal docker networks, as they will never be picked up by
letsencrypt-companion
since they technically do not have an "exposed" port.Example: I'd like to proxy requests for a container running Portainer. Since Portainer only interacts with the docker service itself, it can sit on an internal docker network for increased security. However, since
letsencrypt-companion
only picks up containers with exposed ports, and this Portainer container can't expose a port on an internal docker network, it will never get a cert created byletsencrypt-companion
.This might be better as some kind of option, maybe an environment variable that can be set, but since
letsencrypt-companion
is only looking for containers with theLETSENCRYPT_HOST
andLETSENCRYPT_EMAIL
environment variables anyway, it seems reasonable to just remove this argument from thedocker-gen
statement.