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

Run a local Graph Node on linux problem with host.docker.internal #1149

Closed
Npizza opened this issue Sep 1, 2019 · 1 comment
Closed

Run a local Graph Node on linux problem with host.docker.internal #1149

Npizza opened this issue Sep 1, 2019 · 1 comment

Comments

@Npizza
Copy link

Npizza commented Sep 1, 2019

Do you want to request a feature or report a bug?
bug
What is the current behavior?
I am trying to set up localy graph node with docker and when I am trying to fix the host.docker.internal bug something is not going as expected.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

I am following the instructions on the https://thegraph.com/docs/quick-start .
First I Set up Ganache CLI then I am trying to run the Graph Node.
I Clone Graph Node, Enter the Graph Node's Docker directory and then I go to Note for Linux users:

There I type the command:
$ CONTAINER_ID=$(docker container ls | grep graph-node | cut -d' ' -f1)
and then the command:
$ docker exec $CONTAINER_ID /bin/bash -c 'ip route | awk \'/^default via /{print $3}\''

But the bash I think is waiting for me to complete the command.
So I look what the CONTAINER_ID variable has with echo and I found out that there is nothing there.
Then I type docker container ls to see what is the list of the containers and I found that is empty too.

What I am missing?

What is the expected behavior?
To print the host's IP

@Npizza
Copy link
Author

Npizza commented Sep 2, 2019

I found the solution to the problem.
It seems for some reason that
$ docker exec $CONTAINER_ID /bin/bash -c 'ip route | awk \'/^default via /{print $3}\''
has some syntax error and when you try to run it it waits for some input.
I found a work around this by doing this steps:
-I run the docker contrainer with docker-compose up ( If you want you can run it on the background with -d attribute)
-On a other terminal run $ CONTAINER_ID=$(docker container ls | grep graph-node | cut -d' ' -f1)
This way you have on the CONTAINER_ID the name of the container.
-Execute this command to have access to the terminal of the docker container docker exec -it $CONTAINER_ID bash
-And execute ip route | awk '/^default via /{print $3}' to take the IP that you wanted for the next step of the tutorial.

Cheers!

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

1 participant