Closed levino closed 6 years ago
I have the same issue.
Update: actually -h 0.0.0.0
works. Here is my docker-compose.yml
:
version: "2.1"
services:
ganache:
image: trufflesuite/ganache-cli:v6.1.6
ports:
- 8545:8545
entrypoint:
- node
- ./build/cli.node.js
- --host=0.0.0.0
- --port=8545
- --gasLimit=7992181
It has to be -h=0.0.0.0
.
Here is my also working docker-compose.yml
version: '3.2'
services:
dev-blockchain:
image: trufflesuite/ganache-cli:v6.1.6
ports:
- 8545:8545
command: ["-h=0.0.0.0"]
Closing as "weirdly implemented but kinda works as expected".
Adding some keywords to help folks find this (took me a while to get here). Thanks @Levino @Zorato for posting the fix on this.
ganache-cli docker metamask unknown network ports can't connect
Further, we addressed this issue in #559. In the next release of ganache-cli
(and its Docker container), the host should default to 0.0.0.0
for Docker instances
Using this
docker-compose.yml
:I cannot connect to
localhost:8545
. Last working version is6.1.3
. The difference is in the logs:6.1.3
says:Running on localhost:8545
(which actually means0.0.0.0:8545
I guess)6.1.6
says:Running on 127.0.0.1:8545
(which seems to really mean that it only listens on127.0.0.1
but that is very wrong in docker, because it is now running in a container and the port can only be reached from outside or the network if the service binds to the interface0.0.0.0
)Remark: Using
-h 0.0.0.0
does not work, gives some error abouteadrr not found
.