Open mitra42 opened 6 years ago
Thanks for the suggestions, will welcome for any fix/pr. @mitra42
Sure - working on the fixes now ... and will merge back or make suggestions.
OK - this turned out a lot more complex than we thought and we have an approach now (which we worked through with @parkan) that uses supervisord to restart ipfs when it crashes, and a start_ipfs.sh script that creates the repo ONLY if its not been created before. I'm more than happy to share the Dockerfile (stripped down to just the IPFS parts), and start_ipfs.sh script, but I don't have a completely separate working Dockerfile since the one we actually use also installs webtorrent, gun and our gateway.
If someone wants a copy please PM me (mitra@archive.org) and I'll send them the copies (note to self, its in EN/DockerfileForIPFS
), and I'm happy that those be shared publicly once someone else confirms they work well for them and aren't too specific to or own needs.
Thanks for this docker, it was super useful to help us put together a potential production IPFS node for dweb.archive.org.
There are three issues, but they are tightly interrelated so posting as one, since any change could break one while fixing the others.
As I see it, there are three stages. 1) build docker image - when we want the configuration to be defined. (We add three more lines to your image to fix CORS and enable URLStore). Looks good in current Dockerfile.
2) Run container first time on new machine.- when we need a peerid established. The problem is that peer id is set in "ipfs init", so I'm pretty sure each machine will get the same peer id.
3) Restart after a crash (IPFS daemon currently crashes on us approx every 25 hours, so supervisord is restarting it). At this point we want the Repo to remain the same, but in this image I think its going to use the fresh initialized repo each time.
One problem with potential fixes to this sequence - for example the Dockerfile in the go-ipfs repo uses start_ipfs - is that if you start IPFS in the instance and check for an initialized repo, then you can't run the config in the Dockerfile since it appears that you have to run config AFTER the repo is initialized.