Defining extra hosts for Docker deployments
Extra hosts for Docker deployments can be defined when there are network or DNS issues. Defining extra hosts is optional and not a requirement to ensure the connections are successful.
About this task
In some cases on CentOS 8, the host names fail to resolve properly. If the DNS is unreliable in resolving host names to IP addresses, these can be defined manually in the configuration. The following steps work for all supported Linux versions.
Note: When modifying the
yml
file, the indentations
use spaces to indent the text. Do not use tabs. The entries within the file must line up
exactly.Use the networks:
placement as a reference for
extra_hosts:
and the sametime.test:
placement as a
reference for where the -
is placed.
Procedure
-
Open the docker-compose.yml file in edit mode.
- Verify that the formatting is correct. Correct any indentations using spaces.
- Save the changes.
-
Run the following commands to apply the changes.
docker-compose down
docker-compose up -d