:wave: Hi everyone! Can anyone tell me if there is...
# general
s
👋 Hi everyone! Can anyone tell me if there is a way to add network aliases to a docker service. I can see that there is a network advanced option for containers but not in services
l
What's a network alias? You can expose services on whatever host ports you choose. Then you can use load balancers or similar to map DNS names to that particular port on your host. There's probably other solutions, especially if you're using k8s...
s
The alias is the network name that other containers use to find the container not using K8s using a docker swarm
l
Ah. Doesn't swarm use docker-compose.yml? It's all configured in there.
s
Yes but I am setting everything up through Pulumi without a compose file
l
So.. not a swarm?
s
yes it is a swarm
the services are replicating over multiple nodes but cannot talk to each other as the aliases are missing
If I manually add these to the hostconfig of the containers all is good
what I really need is access to this
task_spec.networks_advanced
l
Looks like service task specs can be provided container specs, that include networkAdvanced aliases...
s
which brings us back to the original question of how to add this in a service not a container
terraform has it for both by the looks of it
l
Maybe it's missing from the docs only? The SDK is built from the Terraform schema, so it should match...
s
Terraform looks like this
pulumi has this NetworksList<string>