But I don't think this is supported by docker-compose. I would like to have the api-node join both the docker overlay network we created and the host network. If we don’t specify the IP address, Docker Compose binds the port to all the network interfaces. Thus, the external service cannot call back to the api-node, since it is not part of the docker network. The short syntax is a colon-separated string to set the host IP address, host port, and container port: HOST:CONTAINER/PROTOCOL Here, HOST is a host port number or range of port numbers that can be preceded by an IP address. It does not have access to the AWS hosts ip. Since the api-node is not part of the "host" network, the only ip addresses it has are within the docker network. That external service needs to communicate with the api-node, so the api-node gives the external service its ip address during registration.Ĭurrently, all of these services are deployed within AWS, and there is only 1 docker container running per AWS instance. Shouldn’t be a problem for a couple of ports, but definitly gets painfull when you try to map a range of 100 ports. One of these services (call it api-node) also needs to register itself with a different service that is not deployed using docker. Yep, possible, you can map as many host ports to a single container port as you want, thought each mapped port will delay the container start. I deploy these with docker-compose, and have successfully used an overlay network to make it easy to configure the communication between these services. Unify app and infrastructure visibility to proactively resolve issues. It publishes port 8080 locally on the hosts where these two containers. Find answers that matter with Elastic on your preferred cloud provider. docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES. docker service create -replicas 2 -publish modehost,target80,published8080 nginx. The docker ps command shows you all containers that are currently running. Only a single task of a given service can run on each host to prevent port collision. We have a cluster of custom services that appears to the outside world as a single functional unit. The port is mapped directly to the container on that host. I would like to connect a container to both the host network and a custom overlay network.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |