我需要一个docker_compose YAML文件的dockerized版本的RSK节点(见这里)。
它需要一个卷用于配置文件,另一个卷用于DB。
这是(以RSK Testnet Docker为例)):
version: "3"
services:
rsk-testnet:
image: testnet:latest
build:
context: .
dockerfile: Dockerfile.Testnet
restart: always
volumes:
- rsk_db:/var/lib/rsk/database
- rsk_cfg:/etc/rsk
ports:
- 4444:4444
- 50505:50505
volumes:
rsk_db:
driver: local
driver_opts:
o: bind
type: none
device: /rsk/database
rsk_cfg:
driver: local
driver_opts:
o: bind
type: none
device: /rsk/conf
A第二次进近可能,最好为数据创建一个单独的卷,而不是与主机共享。因为速度。
version: "3.8"
services:
mainnet:
build: ./docker/rsk
container_name: rsk-node-mainnet
entrypoint: "/usr/bin/java -Dlogback.configurationFile='/etc/rsk/logback.xml' -Drsk.conf.file=/etc/rsk/node.conf -cp /usr/share/rsk/rsk.jar co.rsk.Start > /dev/null 2>&1 &"
volumes:
- rsk-node-storage:/data
# - ./import:/import
restart: unless-stopped
networks:
- rsk-node-mainnet-network
ports:
- '4444:4444'
- '4445:4445'
volumes:
rsk-node-storage:
external: true
networks:
rsk-node-mainnet-network:
external: true
name: rsk-node-mainnet-network
和node.conf:
database.dir = /data/database/mainnet
可能是正确的,你应该在dockerfile中复制你自己的node.conf。或者更改入口点参数并从主机插入node.conf。