Hi Chris,

Thanks for the reply.

can you let me know bit more about alias/cname to the docker host ?

as I already have host-name in my docker file ‘mongo1’, I have tried adding one more entry to mongo1 in my /etc/hosts file and extra_hosts in my docker file and using aliases in networks.

        extra_hosts:
            - "test-domain:mongo1"
127.0.0.1	localhost
127.0.1.1	xxxx-ThinkPad-X270
#127.0.0.1       mongo1 mongo2 mongo3
192.168.0.2	mongo1
192.168.0.3	mongo2
192.168.0.4	mongo3

with the above syntax i get error during initialization.

{
	"operationTime" : Timestamp(0, 0),
	"ok" : 0,
	"errmsg" : "No host described in new configuration 1 for replica set rs0 maps to this node",
	"code" : 93,
	"codeName" : "InvalidReplicaSetConfig",
	"$clusterTime" : {
		"clusterTime" : Timestamp(0, 0),
		"signature" : {
			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
			"keyId" : NumberLong(0)
		}
	}
}

sorry, this is bit confusing for me. It would be great if you have docker file or an etc/hosts file showing how to add an alias name.

Thank you