kubo/bin/container_daemon
Knut Ahlers 3534b039f7 Improve Dockerfile
* Added VOLUME to enable users to keep a state of the repo outside the container
* Added ipfs user to let ipfs run as a normal user and not as root
* Set IPFS_PATH to push IPFS to use the exposed dir
* Improved start script to be more verbose about errors
2015-04-23 23:54:32 +02:00

22 lines
491 B
Bash

#!/bin/bash
# Test whether the mounted directory is writable for us
if ( touch /data/ipfs/write_test 2>/dev/null ); then
rm /data/ipfs/write_test
else
echo "ERR: /data/ipfs is not writable for user 'ipfs' (UID 1000)"
exit 1
fi
echo "Running $(ipfs version)..."
if [ -e /data/ipfs/config ]; then
echo "Found ipfs repository. Not initializing."
else
ipfs init
ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080
fi
ipfs daemon