-
Notifications
You must be signed in to change notification settings - Fork 613
feat: filter containers seen by docker-gen #623
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
base: main
Are you sure you want to change the base?
Conversation
flag.BoolVar(¬ifyOutput, "notify-output", false, "log the output(stdout/stderr) of notify command") | ||
"only include containers with published ports (implies -only-exposed). Bypassed when providing a container published filter (-container-filter published=foo).") | ||
flag.BoolVar(&includeStopped, "include-stopped", false, | ||
"include stopped containers. Bypassed by when providing a container status filter (-container-filter status=foo).") |
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.
"include stopped containers. Bypassed by when providing a container status filter (-container-filter status=foo).") | |
"include stopped containers. Bypassed when providing a container status filter (-container-filter status=foo).") |
-include-stopped | ||
include stopped containers | ||
only include containers with published ports (implies -only-exposed). | ||
Bypassed by when providing a container published filter (-container-filter published=foo). |
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.
Bypassed by when providing a container published filter (-container-filter published=foo). | |
Bypassed when providing a container published filter (-container-filter published=foo). |
-notify-signal signal | ||
signal to send to the -notify-container and -notify-filter. -1 to call docker restart. Defaults to 1 aka. HUP. | ||
All available signals available on the dockerclient | ||
https://github.com/fsouza/go-dockerclient/blob/main/signal.go | ||
-only-exposed | ||
only include containers with exposed ports | ||
only include containers with exposed ports. | ||
Bypassed by when using the exposed filter with (-container-filter exposed=foo). |
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.
Bypassed by when using the exposed filter with (-container-filter exposed=foo). | |
Bypassed when using the exposed filter with (-container-filter exposed=foo). |
-endpoint string | ||
docker api endpoint (tcp|unix://..). Default unix:///var/run/docker.sock | ||
-include-stopped | ||
include stopped containers. | ||
Bypassed by when providing a container status filter (-container-filter status=foo). |
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.
Bypassed by when providing a container status filter (-container-filter status=foo). | |
Bypassed when providing a container status filter (-container-filter status=foo). |
The PR add the
-container-filter
option to filter the containers that docker-gen will see.The option work pretty much like
-notify-filter
and can be used multiple times to combine filters with AND.This:
will result in docker-gen only seeing running container that possess the label
com.github.nginx-proxy.nginx
.Closes #276
Unfortunately Docker filter options for containers does not provide negative filtering, so #117, #210, and #252 won't be entirely fixed by this.
Thanks @tarasov65536 for the inspiration.