compose
compose copied to clipboard
compose control network domain name
When I create a "foo.com" network with docker-compose, the network appears to be changed and to be dynamic.
The containers themselves talk to each other with TLS, and do hostname validation. So, the DNS resolution for my network has to have the services be addressed in the form of "foo.bar.com".
Today I'm handling this by having docker-compose attach to an externally created network so that I can control the FQDN. Is there another way to accomplish this?
Are you looking for aliases
?
Are aliases within a domain, or can they be FQDNs?
They're always fully qualified.
I believe my issue is that for:
version: "2"
networks:
bar.com:
services:
foo:
networks:
bar.com:
a FQDN is created based on the service label (not dynamic container name) and the dynamic network name (not network label). So my service isn't reachable as foo.bar.com
, but something like foo.folder_bar.com
.
Would it be worth opening an issue that there should be a default alias created of foo.bar.com
?
This should work, unless I'm misunderstanding the use case.
version: "2"
networks:
bar.com:
services:
foo:
networks:
bar.com:
aliases:
- foo.bar.com
Yes, it does. I'm wondering if I should open an issue that that particular alias should be automatic under compose - today without specifying an alias, your service will wind up with a DNS name in the form of foo.foldername_bar.com
This report is more than a year old and for me falls in to the category of useability issues. The workaround above is non intuitive and most awkward. Setting the fqdn foo.bar.com directly would IMHO be most sensible.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it had not recent activity during the stale period.
Again automatically closed with no fix. The need is still there - how do you no that it's not?
We added the bot to do some automatic cleanup & get more visibility on what's really matter or not. There's currently too much issues open, some for years, and it can be difficult to prioritize what to do.
When the bot mark an issue as stale, you only have to add a comment to remove this status.
I reopen the issue
This issue has been automatically marked as not stale anymore due to the recent activity.
This issue has been automatically marked as not stale anymore due to the recent activity.
How about teaching the bot not to close issues that have a certain comment content /number of upvotes or the like?
Where is this ticket up to ? I would expect that
foobar:
image: ${image_foobar}
domainname: test-local
dns_search:
- test-local
would have expected
- give the foobar image a DNS entry of
foobar
andfoobar.test-local
in the internal DNS server. It doesn't - to give all containers the default
service-name
andservice.${COMPOSE_PROJECT_NAME}
the latter would mean simply
# test-local/docker-compose.yml
...
foobar:
image: ${image_foobar}
automatically gives the entries foobar
and foobar.test-local
This would make creating test harnesses really nice.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Still a usability issue with a non-intuitive workaround. It's only stale in the sense that there's no proper triage for issues, so as such it may remain a usability issue forever.
This issue has been automatically marked as not stale anymore due to the recent activity.