Skip to content

Build Docker Image

Build blockd Docker image.

Replace VERSION with the latest release (e.g., 0.3.0-alpha.1) in the commands below.

Example: blockd-0.3.0-alpha.1-x86_64-src.tar.gz

Visit blockd releases page to download the latest release.

  • Under Packages, download blockd-VERSION-src.tar.gz
  • Under Other, download blockd-VERSION-shasums.txt
  • Under Other, download blockd-VERSION-shasums.txt.asc

Confirm the integrity and authenticity of the download and extract:

  1. Verify signature:

    Terminal window
    gpg --verify blockd-VERSION-shasums.txt.asc
  2. Verify checksum:

    Terminal window
    sha256sum -c --ignore-missing blockd-VERSION-shasums.txt
  3. Extract archive:

    Terminal window
    tar xvf blockd-VERSION-src.tar.gz

Create data directory and copy a configuration template:

Terminal window
cd blockd-vVERSION
mkdir -p data
cp conf/blockd.example_simple.yml conf/blockd.yml # or conf/blockd.example_tls.yml

Edit conf/blockd.yml and change values for your environment. See Configuration for details.

Terminal window
export NO_COLOR=1
docker build -f docker/Dockerfile -t blockd:latest .
Terminal window
docker run -d \
--name blockd \
--restart unless-stopped \
-v $(pwd)/conf/blockd.yml:/conf/blockd.yml:ro \
-v $(pwd)/data:/data \
-p 21000:21000 \
blockd:latest
FlagPurpose
-dRun as detached (background) process
--restart unless-stoppedAuto-restart on failure or host reboot
-v .../blockd.yml:/conf/blockd.yml:roConfig file, read-only
-v .../data:/dataPersistent database volume
-p 21000:21000Expose API port

Create a docker-compose.yml in the project root:

services:
blockd:
image: blockd:latest
container_name: blockd
restart: unless-stopped
ports:
- "21000:21000"
volumes:
- ./conf/blockd.yml:/conf/blockd.yml:ro
- ./data:/data

Start with:

Terminal window
docker compose up -d
Terminal window
# View logs
docker logs -f blockd
# Stop
docker stop blockd
# Start
docker start blockd
# Remove container (data volume is preserved)
docker rm -f blockd