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

docker container names #342

Closed
benjamine opened this issue Jul 24, 2014 · 6 comments
Closed

docker container names #342

benjamine opened this issue Jul 24, 2014 · 6 comments

Comments

@benjamine
Copy link

Hi, I noticed that container names created by fig always have a number on their name:

DATABASE_1_PORT=tcp://172.17.0.32:5432
DATABASE_1_PORT_5432_TCP=tcp://172.17.0.32:5432
DATABASE_1_PORT_5432_TCP_ADDR=172.17.0.32
DATABASE_1_PORT_5432_TCP_PORT=5432
DATABASE_1_PORT_5432_TCP_PROTO=tcp

I suppose the reason is there could be multiple containers running the same image (database), but that seems to violate the "principle of least suprise" to me, I wonder if could prevent this by making 1st container not be numbered, as that's the case for most people.
In other words change database_1 to just database, and add numbers for 2,3,4 to the rest if there's any.
I think that would help newcomers (like me) thoughts?

@aanand
Copy link

aanand commented Jul 24, 2014

Yeah, have a look at #37 - we should be adding a link alias without a numeric suffix.

@aanand aanand closed this as completed Jul 24, 2014
@benjamine
Copy link
Author

ok, but I don't think there's any problem with env vars, in any case that's for docker to decide.
what is fig to decide is how to name containers, and as you comment here, the added _1 is what makes it confusing, or should I say unexpectable.
In other words, I think the web container should be named web

@d11wtq
Copy link

d11wtq commented Jul 25, 2014

The problem if you name the web container just 'web' in docker, is that you are then limited to running one project at a time. If you have two projects that both have a service 'web' (which is extremely likely in a company that develops microservice like where I work), they will clash. You at least do need to prefix the project name, but you don't need the _1 on the first instance, I agree.

@benjamine
Copy link
Author

exactly, you can start adding numbers for 2, 3 and 4, but the vast majority of use cases you only use 1, so I would make it simple for them.

@d11wtq
Copy link

d11wtq commented Jul 25, 2014

Agreed. PR welcomed :octocat:

@benjamine
Copy link
Author

cool, just sent #349 to solve this

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