Search code examples
dockercoreosipfs

IPFS public node in a Docker container?


I'm attempting to set up an IPFS server on my home network. I have a CoreOS box that I'd like to get up and running with it. Since CoreOS focuses on Docker containers, that's the setup I've got.

I have got it working such that I can spin up a Docker container running the daemon:

docker run --name ipfs.service \
  -p 8080:8080 -p 4001:4001 -p 5001:5001 \
  ipfs/go-ipfs:v0.4.14

And I've logged into the running container (docker exec -it ipfs.service sh) and updated the "Addresses.Gateway" option to be "/ip4/0.0.0.0/tcp/8080".

On startup, the log does show:

API server listening on /ip4/0.0.0.0/tcp/5001
Gateway (readonly) server listening on /ip4/0.0.0.0/tcp/8080
Daemon is ready

Now, I'd like to be able to browse the IPFS content from another workstation on my home network. However, navigating to http://192.168.0.100:8080/ipfs/QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ/cat.jpg (where my CoreOS has a local IP address of 192.168.0.100), I get a "Connection Refused" error in Chrome.

Using SSH tunneling I can get access to the IPFS content (forwarding the server 8080 port to my local workstation), so I know that the IPFS server is serving something to the outer CoreOS layer at least.

But how to get it one layer further? I'm unsure if this is a CoreOS configuration error or an IPFS daemon configuration error. How can I further troubleshoot where this connection is being dropped?


Solution

  • This issue turned out to be an issue with the IPFS version; updating to the latest version of IPFS caused the issue to go away.