mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 18:37:45 +08:00
- Have two Dockerfiles doing essentially the same, but optimized for build time (for tests) and image size (for Docker Hub) - Fetch gx dependencies - Expose port 4002 for utp - Specify go version, currently 1.5.3-r0 - Create ephemeral fs-repo if none is mounted - Have t0300-docker-image actually test IPFS, not just an echo - Make everything a bit less hardcoded - Remove dead shacheck License: MIT Signed-off-by: Lars Gierth <larsg@systemli.org>
23 lines
450 B
Bash
23 lines
450 B
Bash
#!/bin/sh
|
|
|
|
user=$(whoami)
|
|
repo="$IPFS_PATH"
|
|
|
|
# Test whether the mounted directory is writable for us
|
|
if [ ! -w "$repo" 2>/dev/null ]; then
|
|
echo "error: $repo is not writable for user $user (uid=$(id -u $user))"
|
|
exit 1
|
|
fi
|
|
|
|
ipfs version
|
|
|
|
if [ -e "$repo/config" ]; then
|
|
echo "Found IPFS fs-repo at $repo"
|
|
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
|
|
|
|
exec ipfs daemon
|