Skip to content
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

Support for labels? #6

Open
lox opened this issue Jun 17, 2015 · 3 comments
Open

Support for labels? #6

lox opened this issue Jun 17, 2015 · 3 comments

Comments

@lox
Copy link

lox commented Jun 17, 2015

Had you thought about the possibility of using container labels and dns?

@tianon
Copy link
Owner

tianon commented Sep 9, 2015

Hmm, interesting idea. How do you envision this working? Some kind of rawdns-specific label for giving containers alternate names, especially multiple containers under the same name?

@josegonzalez
Copy link

josegonzalez commented Jan 24, 2022

This might be nice to do if we could specify something like the following:

{
	"docker.": {
		"type": "containers",
		"socket": "unix:///var/run/docker.sock",
                "label": "rawdns.hostname"
	}
}

Using this method, if we define two containers like so:

# container 1
docker run --label rawdns.hostname=web IMAGE
# container 2
docker run --name web IMAGE

If a user requests web.docker, the IP of container 1 would be returned (most specific one wins).

If we have two or more containers with the same label, the IPs for both would be returned.

@tianon
Copy link
Owner

tianon commented Jan 27, 2022

One challenge with that is that the way rawdns works is that a DNS request is translated directly to what's essentially a docker inspect call on the specific container name requested -- dealing with labels makes that a more complicated lookup (and one which then has the potential to match multiple containers).

FWIW, I'm still very interested in exploring #26 which would make this easier for other folks to implement/play with (and I think the example linked there already supports something related to container labels, in fact).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants