Tag: networking

Docker-compose extra_hosts on Mac

I’m trying to add a new hosts to my Nginx container with the extra_hosts configuration of Docker-compose. For some reason, I can’t make it work. I’m using Docker for Mac 17.06 CE stable with Docker-Compose v3. Here’s my configuration: nginx: build: ./docker/nginx container_name: nginx ports: – ’80:80′ volumes: – “${PROJECT_ROOT}:/var/www/html:ro” networks: – server extra_hosts: – […]

What would prevent code running in a Docker container from connecting to a database on a separate server?

I have a .NET Core 1.1 app running in a Docker container on Ubuntu 14.04, and it fails to connect to the SQL Server database running on a separate server. The error is: Unhandled Exception: System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or […]

Docker – access another container on the same machine via its public ip, without docker links

On a VPS with a static, publicly routable IP, I have a simple web server running (on port 8080) in a container that exports port 8080 (-p If I spin up another container on the same box and try to curl <public ip of host>:8080 it resolves the address, tries to connect but fails […]

Multicast from docker to host's eth

currently i am trying to send some multicast data from my docker‘s application throughout my host’s eth2 host interface. i did use –net=host option in docker and this was working perfectly, and unfortunately since i need to open multiple instances that uses same port, its impossible for me to use net=host anymore. i have to […]

How to setup group of docker containers with the same addresses?

I am going to install distributed software inside docker containers. It can be something like: container1: – management node container2: – database node container3: – UI node I know how to manage containers as a group and how to link them between each other, however the problem is that ip information is […]

How can I access a docker container via ip address

I’m trying to replace our vagrant development setup with docker. I’d like to be able to use an ip like for my docker container and allow developers to access their container via that IP. I’m currently using docker on Mac OS, but some developers use Windows. How can I make this work?

How to get client IP from request inside haproxy docker container?

I am trying to get the client’s IP address from the request objects in my nodejs server. My technology structure is: I run two docker containers. One for haproxy and other for nodejs which uses expressjs framework. All incoming traffic is first received by haproxy which I use for proxying and load balancing. Haproxy forwards […]

Apply NetEM WAN delay on a docker container interface

I want to apply NetEm delay on the egress traffic of a docker container. Usually, I run: # /sbin/tc qdisc add dev $INTERFACE root netem delay ${DELAY}ms The issue is that I have no idea about the interface to which the container is connected to. For example, I am running the following container: docker run […]

Outbound telnet connection from Docker container refused but works fine on host

I’m facing a network issue on a node hosted via Tutum to AWS. I sshed into the node and ran telnet localhost 3000 and it works great. When I docker exec -it <containerid> bash into one of my containers and run the same command above and I get this error: telnet: Unable to connect to […]

Docker with multiple exposed ports

I have a container with say, 3 ports, 1000 (nodejs-express), 1001 (python-flask) and 1002 (angular2-client) exposed. When I use docker run –name test -d -p 1000:1000 -p 1001:1001 -p 1002:1002 docker_image Only the Express server is working fine on the host computer. However, when I log into the container and do curl, all three servers […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.