cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1398
Views
0
Helpful
1
Replies

Cisco IC3000: how to make two docker containers communicate?

simon_ntt
Level 1
Level 1

Hello,

 

I'm trying to make two containers communicate on a Cisco IC3000 edge gateway. I already know how to do that in a classic docker setup but I struggle to replicate the same thing on the IC3000.

 

For example, considering the following architecture diagram where container A (a frontend app) and container B (the backend) both listen on port 80

ic3000-help.drawio.png

What I would normally do in docker is to create a network using the following command:

docker network create network-test

 

And then I would start my containers like this:

docker run --rm -d --name container_a --network network-test -p 8080:80 container_a
docker run --rm -d --name container_b --network network-test container_b

 

That way, the code of container A would be able to query container B by using its docker name, eg:

GET http://container_B/endpoint_name

 

And then I would simply start a browser on my host machine and navigate to http://localhost:8080 to see the frontend.

 

I didn't saw any way to do that after reading the documentation but I've seen on this documentation page (under the "

Statically assigning IP addresses" section) that it's possible to assign static IP addresses when activating a container using the ioxclient:

ioxclient application activate container_a container_a/activation.json
ioxclient application activate container_b container_b/activation.json

 

As an example, here's the content of activation.json for container_a:

{
    "resources": {
        "profile": "c1.tiny",
        "network": [
            {
                "interface-name": "eth0",
                "network-name": "iox-bridge0",
                "mode": "static",
                "ipv4": {
                    "ip": "1.1.1.2",
                    "prefix": "30"
                }
            },
            {
                "interface-name": "eth1",
                "network-name": "iox-nat_docker0",
                "port_map": {
                    "mode": "custom",
                    "tcp": {
                        "8080": "80"
                    }
                }
            }
        ]
    }
}

 

The activation step with the ioxclient responds positively but when I go on the container_a's tab on the IC3000 GUI I can see that the interface don't get the correct network:

Screenshot from 2022-04-01 16-12-39.png

 

And when I browse on http://<cisco-ic3000-ip-address>:8080 I can't access the frontend despite having bound port 8080 to port 80 on network iox-nat_docker0 in the activation.json file.

 

Any idea what I'm doing wrong here?

 

PS: I created a repository containing the (very simple) code of those containers + the package.yaml and activation.json files.

 

Kind regards,

Simon

1 Reply 1

Alexander Stevenson
Cisco Employee
Cisco Employee