Tag: networking

Discovering nsqd server address from nslookupd

I’m running an nsq cluster in Docker containers using the following docker-compose.yaml file: version: ‘2’ services: nsqlookupd: image: nsqio/nsq command: /nsqlookupd ports: – “4160” – “4161:4161” nsqd: image: nsqio/nsq command: /nsqd –lookupd-tcp-address=nsqlookupd:4160 –data-path=/data volumes: – data:/data ports: – “4150:4150” – “4151:4151” nsqadmin: image: nsqio/nsq command: /nsqadmin –lookupd-http-address=nsqlookupd:4161 ports: – “4171:4171” volumes: data: Everything runs fine. […]

Docker Containers with different Network Interface

Problem: I want to have multiple VPN Servers running in Docker containers each with there own public IP. With the -p parameter I am able to connect to each one separately but the Public ip that I see is the eth0 interface not the one that I want it to be (eth0:1) so how can […]

How do I debug a network — probably Hyperkit caused issue — of a Docker setup on a Mac?

Problem: Network is not routed to the host machine. e.g.: docker run -tip 80:8080 httpd does NOT result in apache responding on localhost:8080 on the host machine or on docker.local:8080 or anything like that. If I try to connect from inside, the container works fine: docker run -ti debian curl 172.17.0.2 <html><body><h1>It works!</h1></body></html> It seems […]

Multiple instances of an application

I have an application for which I need to spawn 2 instances in the same host defining 2 different environments. The application docker-compose.yml version: ‘2’ services: db: image: postgres web: image: nginx depends_on: – db networks: default: external: name: my_reverse_proxy_network As you can see I’m using a network so my reverse proxy can communicate with […]

Simple Træfɪk reverse proxy installation

I’m trying the nice Træfɪk reverse proxy with some docker containers. Here is my Træfɪk docker-compose.yml: version: ‘2’ services: traefik: image: traefik command: –web –docker –docker.domain=my-domain.net –logLevel=DEBUG ports: – “80:80” – “8080:8080” volumes: – /var/run/docker.sock:/var/run/docker.sock – /dev/null:/traefik.toml Here is my services’ docker-compose.yml web part: version: ‘2’ services: # […] web: build: . # An nginx […]

How to access a running docker containers external ip from within the container?

When I deploy via docker-compose, I can run inspect on any of the containers and see the external ip. $ docker inspect –format ‘{{ .NetworkSettings.IPAddress }}’ parentserver >>>172.17.0.3 My question is, if someone were to, say, git clone my repository on their local machine and run docker-compose, is it guaranteed that the IP of parentserver […]

How to mimic a Docker registry down situation

I’m trying to test how our app handles when the Docker registry becomes unavailable for it to pull Docker images, and want to mimic the situation. I don’t have any control over the firewall rule of the network or DNS of the servers. The only changes I can make are on the VM I’m using, […]

REST request across networks

Let’s say I have two docker networks on the same machine. (Network-1 and Network-2) On each network, I have containers. (Container-1-Network-1 and Container-1-Network-2 etc.) I need to send a PUT request from Container-1(172.18.0.x) to Container-2 (172.19.0.x) but I get ‘connection refused’ because different networks can’t communicate with each other. What are my options here? Can […]

How to create docker containers with the same internal IP address?

I have an environment where I need to run some external software into Docker containers. This software is trying to connect to our product by specific IP address – let’s say 192.168.255.2 – and this address is fixed and cannot be changed. Moreover, host IP address must be also set to specific IP – let’s […]

pip install doesn't work correctly in docker

Question i can’t install any package during building an image. pulling from docker hub is OK, but problems occurred when docker try to use network to build an image. for example, if i try to run: $ docker build -t sample-image:latest . … and the Dockerfile that used by above command has following line: RUN […]

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