Open danw-mpl opened 3 years ago
@danw-mpl - Would you specify that in your docker-compose? There is not currently an explicit way to specify it in the Commandeer UI, but I am happy to add that. How exactly would it work?
Hello, thanks for replying.
Straight forward enough. Using the standard Docker Compose way of creating named networks. Example:
services:
localstack:
{...}
networks:
- localstack
{...}
networks:
localstack:
driver: bridge
name: localstack
In terms of getting the network(s) the container is attached to, there are a couple ways:
Possibly an option although the network 'ID' is present in the array and the user won't know what it is without using the Docker CLI.
$>docker inspect -f '{{range.NetworkSettings.Networks}}{{.Aliases}}{{end}}' localstack_main
[0172d5097474 localstack]
An option to get the first network in the array
$>docker inspect localstack_main | jq -r '.[].NetworkSettings.Networks | keys | first'
localstack
Alternatively you could just run docker inspect localstack_main
and work out how to get the network key:
$>docker inspect localstack_main
{
"Id": "0172d509747472fa0239dca1bed9a1d88cc2378bfbc15f53089d78e31107f21c",
{...}
"NetworkSettings": {
{...}
"Networks": {
"localstack": {
{...}
"Aliases": [
"0172d5097474",
"localstack"
],
{...}
}
}
}
}
]
Found a workaround for my use case.
To get DNS name resolution working between containers and have Localstack available from the host (for Commandeer), I added two networks to docker-compose.yml.
- default
- localstack
Hello,
We're using Docker Compose to launch Localstack and another container which runs a CloudFormation template against it on launch. To do this, both containers need to be on the same network to resolve the localstack hostname.
I can't find an option in Commandeer to specify the Docker network that Localstack is using. Is this available? If not, is possible to request this as a feature?
Alternatively if anyone else is running a CloudFormation template against Localstack, happy to change our approach.