Skip to content

Conversation

patschi
Copy link
Member

@patschi patschi commented Sep 25, 2025

Contribution Guidelines

What does this PR include?

Short Description

This adds hostnames to all docker containers. It does NOT change the DNS hostnames the services use to communicate between them and are solely for hostname within the containers - as in, they use now static hostnames instead of the docker ID. This might make it easier to identify the container, especially for logging.

Worked fine:

$ for c in $(docker ps -q -a); do docker exec $c hostname; done
watchdog
acme
nginx
ofelia
rspamd
postfix
dovecot
mysql
postfix
clamd
php
redis
sogo
controller
unbound
netfilter
memcached
olefy

Closes #4505

Affected Containers

All except rspamd. rspamd already had this.

Did you run tests?

What did you tested?

Start the stack, check for errors.

What were the final results? (Awaited, got)

No errors found.

@dragoangel
Copy link
Collaborator

dragoangel commented Sep 25, 2025

@patschi this not changes PTR resolving? Assume it is, but anyway LGTM.

@patschi
Copy link
Member Author

patschi commented Sep 25, 2025

Haven't seen it being changed, no. Stack stays up and DNS is resolved as before.

Also docker docs only state:
https://docs.docker.com/reference/compose-file/services/#hostname

hostname declares a custom host name to use for the service container. It must be a valid RFC 1123 hostname.

No mention of any influence of DNS/PTR whatsoever.

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

Successfully merging this pull request may close these issues.

2 participants