Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gateway timeout #25

Closed
lrkwz opened this issue Sep 3, 2019 · 5 comments
Closed

Gateway timeout #25

lrkwz opened this issue Sep 3, 2019 · 5 comments

Comments

@lrkwz
Copy link

lrkwz commented Sep 3, 2019

I cannot make the gateway work properly.
I've read #21 and bound my app to the host ip 172.20.0.1 (resulting from docker network inspect bridge --format='{{( index .IPAM.Config 0).Gateway}}').

Relevant part of docker-compose.yml is:

version: '3'
services:
    my-api-gateway:
        image: qoomon/docker-host
        cap_add: [ 'NET_ADMIN', 'NET_RAW' ]
        # mem_limit: 4M
        restart: on-failure
    web:
        image: my-webapp-ui
        ports:
        - "80:80"

Then I start the java api mvn spring-boot:run which listens on 172.20.0.1 port 8080.

From the host shell:

$ curl http://172.20.0.1:8080/management/health
{
  "status" : "UP"
}

From the goomon/docker-host container:

$ docker-compose exec my-api-gateway sh
# curl http://172.20.0.1:8080/management/health
{
  "status" : "UP"
} 

From the linked container:

$  docker-compose exec web sh
# curl http://my-api-gateway:8080/management/health
curl: (7) Failed to connect to my-api-gateway port 8080: Operation timed out

What's wrong in my config?

@qoomon
Copy link
Owner

qoomon commented Sep 3, 2019

Which host environment you're working with?
Can you access the host by do curl http://172.20.0.1:8080/management/health from within web container?
Can you ping my-api-gateway from within web container?

@lrkwz
Copy link
Author

lrkwz commented Sep 4, 2019

Working with ubuntu 18.04

Yes I can both curl the host ip and ping the gateway name.

No firewall in the way

@qoomon
Copy link
Owner

qoomon commented Sep 5, 2019

Strange. What are the logs of my-api-gateway when starting?
Do you have the same problem when you try one of the example at https://github.com/qoomon/docker-host/blob/master/README.md

@lrkwz
Copy link
Author

lrkwz commented Sep 7, 2019

The logs where pretty normal:

Docker Host: 172.20.0.1 (default gateway)
Forwarding ports: 0:65535

I resolved dropping all the containers, removing all the docker-networks and start all over again.
It must have been a mess with the "real" networks (eth, wifi) and docker's nets.

Sorry for bothering you.

@lrkwz lrkwz closed this as completed Sep 7, 2019
@qoomon
Copy link
Owner

qoomon commented Sep 7, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants