2

I am creating a Ruby client to connect to Ethereum node inside a docker container. So far,

I was able to run ethereum-go inside docker container Then I bash into docker container & able to connect my ruby client using ipc file location .ethereum/rinkeby/geth.ipc

But is there a way I can connect to that docker ethereum node from another container? or else from host computer? Because I want to run my Ruby client in another container

  • Docker support mapping a file in the container to a file in the host with the --volume option. I've never tried it with a pipe/unix socket. – Ismael Oct 21 '17 at 17:34
2

I am not familiar with RUBY. I am trying same in GoLang though.

I hope my work can help you get started. I created this docker-compose.yml. I run the client by docker-compose up.

version: '2'

services:
  etherum-client:
      image: ethereum/client-go:stable
      ports:
          - "30303:30303"
          - "8545:8545"
      volumes:
          - ./share/ethereum/:/root/.ethereum/
      command: --rinkeby --rpc --rpcaddr "0.0.0.0" --fast

As the volume is shared, you get the geth.ipc file created in your MAC also.

ALSO you can SH into the docker client by simple command docker exec -it <container name> sh

Inside shell I can then connect to geth using command geth attach ipc:/root/.ethereum/rinkeby/geth.ipc

Hope it helps.

  • i can connect via IPC in the container docker exec -ti appetissimo-ethereum geth attach ipc: but i can't connect from host (ipc path is correct) – 4ntoine Jul 3 '18 at 11:32

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.