ipfs Docker 部署(更新ing)
-
mkdir -p /data/ipfs_node/ipfs_staging mkdir -p /data/ipfs_node/ipfs_data export ipfs_staging=/data/ipfs_node/ipfs_staging export ipfs_data=/data/ipfs_node/ipfs_data docker pull ipfs/go-ipfs:latest docker run -d --name ipfs_host -v $ipfs_staging:/export -v $ipfs_data:/data/ipfs -p 4001:4001 -p 8080:8080 -p 5001:5001 ipfs/go-ipfs:latest
查看Docker 启动情况
docker logs -f ipfs_host
输出
Changing user to ipfs ipfs version 0.9.0 generating ED25519 keypair...done peer identity: 12D3Koxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx initializing IPFS node at /data/ipfs to get started, enter: ipfs cat /ipfs/QmQPeNsJxxxxxxxxxxxxxxxxxxxxxxxxx/readme Initializing daemon... go-ipfs version: 0.9.0-179d1d1 Repo version: 11 System version: amd64/linux Golang version: go1.15.2 Swarm listening on /ip4/127.0.0.1/tcp/4001 Swarm listening on /ip4/127.0.0.1/udp/4001/quic Swarm listening on /ip4/172.17.0.5/tcp/4001 Swarm listening on /ip4/172.17.0.5/udp/4001/quic Swarm listening on /p2p-circuit Swarm announcing /ip4/127.0.0.1/tcp/4001 Swarm announcing /ip4/127.0.0.1/udp/4001/quic Swarm announcing /ip4/172.17.0.5/tcp/4001 Swarm announcing /ip4/172.17.0.5/udp/4001/quic Swarm announcing /ip4/62.210.140.121/udp/4001/quic API server listening on /ip4/0.0.0.0/tcp/5001 WebUI: http://0.0.0.0:5001/webui Gateway (readonly) server listening on /ip4/0.0.0.0/tcp/8080 Daemon is ready
-
访问地址:http://ip:5001/webui
如果显示错误,请添加跨域设置!
一定要替换 命令中的 IIPP 为你的外网IP!!!docker exec ipfs_host ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://IIPP:5001", "http://localhost:3000", "http://127.0.0.1:5001", "https://webui.ipfs.io"]' docker exec ipfs_host ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST"]'
-
这个是拿来干嘛的啊?
-
@michaeltan 好像是个分布式图床