ruimarinho / docker-bitcoin-core

A bitcoin-core docker image
https://hub.docker.com/r/ruimarinho/bitcoin-core/
MIT License
369 stars 208 forks source link

How to use prune option when using this image #126

Closed anver closed 2 years ago

anver commented 2 years ago

How to use prune option when using this image so that I don't have to allocate a full 400GB hdd space and run a real full node, any info is really appreciated, thx

I managed to create a docker-compose.yml file here is the contents below


version: '3.9'
services:
  bitcoind:
    image: ruimarinho/bitcoin-core:22.0
    container_name: bitcoind
    volumes:
      - ./bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf
      - ./data:/home/bitcoin/.bitcoin
    environment:
      - printtoconsole=1
      - prune=550
      - rpcallowip=172.20.0.0/16
      - rpcauth="foo:8a3sdfw32323wefsdf0e02b14fb62e3117384023da030c0$e6dadfsdfsdf2werfrf"
    ports:
      - "8332:8332"
      - "8333:8333"
      - "38332:38332"
      - "38333:38333"
      - "18332:18332"
      - "18333:18333"
      - "18444:18444"
      - "18443:18443"

networks:
  default:
    external: true
    name: nginx-proxy-network

The bitcoind container is up and running but the prune doesn't seem to work, my hdd space is crossing over 20GB after few minutes, what's the solution to use pruned container ? Thanks any insight is much appreciated.
torkelrogstad commented 2 years ago

You need to pass prune as a command argument, not an environment variable.

You could also write prune=550 in your bitcoin.conf file.

anver commented 2 years ago

You need to pass prune as a command argument, not an environment variable.

You could also write prune=550 in your bitcoin.conf file.

Yeah I fugured that out, i'm now able to run the daemon successfully but i'm not using docker-compose for that, just everything on the command prompt works gr8.