Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Obtain container hostname from specified Docker container label #1381

Closed
2opremio opened this issue Sep 3, 2015 · 6 comments
Closed

Obtain container hostname from specified Docker container label #1381

2opremio opened this issue Sep 3, 2015 · 6 comments
Assignees
Milestone

Comments

@2opremio
Copy link
Contributor

2opremio commented Sep 3, 2015

TL;DR Add a new flag to weave proxy --hostname-from-label which specifies a label key from which to extract the container's hostname.

We already added --hostname-match and --hostname-replacement to the proxy, allowing to derive hostnames from transformations of container names (see #1126).

For ECS this is not enough since the original specified container names are mangled destructively, not allowing to retrieve the original name at spawning time.

However, I just found out that ECS adds a label, com.amazonaws.ecs.container-name, to every container with the original container name.

We can add a new flag to weave proxy, --hostname-from-label to specifiy a label key from which to extract the container's hostname.

@rade
Copy link
Member

rade commented Sep 3, 2015

We can add a new flag to weave proxy, --hostname-from-label to specifiy a label key from which to extract the container's hostname.

And this could work in conjunction with the existing options, right?

@2opremio
Copy link
Contributor Author

2opremio commented Sep 3, 2015

Yes, I don't see a reason why it wouldn't.

@rade
Copy link
Member

rade commented Sep 3, 2015

ok. hurry up, let's try to get this into 1.1 :)

@2opremio
Copy link
Contributor Author

2opremio commented Sep 3, 2015

I'm on it!

@rade rade added this to the current milestone Sep 4, 2015
@rade rade closed this as completed in 99b482b Sep 4, 2015
@rade rade modified the milestones: 1.1.0, current Sep 4, 2015
@faddat
Copy link

faddat commented Dec 18, 2015

Can you give me an example of how I can use this?

@faddat
Copy link

faddat commented Dec 18, 2015

Nevermind. I did not know what docker labels could take key+value. For the next ignorant sucker:

From the docker docs:

label (label= or label==)

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

No branches or pull requests

3 participants