mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-22 02:47:48 +08:00
* 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
22 lines
491 B
Bash
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
|