Skip to content

Latest commit

 

History

History
71 lines (48 loc) · 2.61 KB

File metadata and controls

71 lines (48 loc) · 2.61 KB

Docker

Fiber release tags publish official container images to Docker Hub at nervos/fiber and mirror the same tags to GHCR at ghcr.io/nervosnetwork/fiber. Release tags are published as image tags with the same version, and stable releases also update the latest tag.

Build locally

docker build -f docker/Dockerfile -t fiber:local .

Run the published image

mkdir -p ./fiber-node/ckb
# Put your CKB private key in ./fiber-node/ckb/key before starting the node.

docker run --rm -it \
  --name fiber-node \
  -e FIBER_SECRET_KEY_PASSWORD='YOUR_PASSWORD' \
  -e RUST_LOG='info' \
  -v "$(pwd)/fiber-node:/fiber" \
  -p 8228:8228 \
  nervos/fiber:<release-tag>

If you prefer GHCR, replace the image reference with ghcr.io/nervosnetwork/fiber:<release-tag>.

On first start, the image copies the bundled testnet config to /fiber/config.yml if the file does not already exist. To bootstrap from the bundled mainnet config instead, set FIBER_CONFIG_TEMPLATE=/usr/local/share/fiber/config/mainnet/config.yml.

The image also includes fnn-cli for administration tasks.

The RPC service listens on 127.0.0.1:8227 in the bundled configs, so publishing port 8227 from the container is not enough by itself. If you need remote RPC access, update rpc.listening_addr in your mounted config first.

Use fnn-cli with Docker

If the node is already running in a container, the simplest way to use fnn-cli is to execute it inside the same container so it can talk to the default 127.0.0.1:8227 RPC endpoint:

docker exec -it fiber-node fnn-cli info
docker exec -it fiber-node fnn-cli channel list_channels
docker exec -it fiber-node fnn-cli payment list_payments

For interactive mode:

docker exec -it fiber-node fnn-cli

If you enabled RPC authentication, pass the token the same way as on bare metal:

docker exec -it fiber-node fnn-cli --auth-token 'YOUR_TOKEN' info

The full CLI reference is available in ../crates/fiber-cli/README.md.

Migrate data with Docker

When upgrading between versions that require a storage migration, stop the node container first and back up the mounted data directory.

Current releases run the unified migration system when fnn opens the store. If the existing database predates the unified migration epoch, upgrade it with the v0.8.x fnn-migrate binary before starting a current image:

docker run --rm -it \
  -v "$(pwd)/fiber-node:/fiber" \
  nervos/fiber:<v0.8.x-release-tag> \
  fnn-migrate -d /fiber

After the legacy migration finishes, start the new image version again with the same bind mount.