4

I am trying to run a node inside a docker container.

I am able to run a geth node locally, and attach it via IPC with these simple commands:

geth --fast --cache=512 Then geth attach, it works fine.

Then I run a docker container (ethereum/client-go) with the same parameter, volume mounted on same ethereum folder.

Docker command:

docker run -d --name ethereum-node -v /Users/****/Library/Ethereum:/root/.ethereum -p 8545:8545 -p 30303:30303 ethereum/client-go --fast --cache=512

The geth.ipc file is present, but I cannot attach. $ geth attach Fatal: Unable to attach to remote geth: dial unix /Users/****/Library/Ethereum/geth.ipc: connect: connection refused

I tried to read/write geth.ipc:

  • When geth is run locally: $ cat geth.ipc {"jsonrpc":"2.0","error":{"code":-32600,"message":"EOF"}}
  • When under container : $ cat geth.ipc cat: geth.ipc: Connection refused

Running OSX 10.12.1, docker 1.12.3

1
$ docker exec -it ethereum-node /geth attach ipc://root/.ethereum/devchain/geth.ipc

Try to use this command if it works. Maybe you should change geth.ipc path in the command.

1

Perhaps you should try

geth attach http://localhost:8545

The default geth console connectivity is via IPC which requires access to geth.ipc file handler.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.