Build Docker Image
Build blockd Docker image.
Prerequisites
Section titled “Prerequisites”- Docker installed (install)
Download
Section titled “Download”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
Verify & Extract
Section titled “Verify & Extract”Confirm the integrity and authenticity of the download and extract:
-
Verify signature:
Terminal window gpg --verify blockd-VERSION-shasums.txt.asc -
Verify checksum:
Terminal window sha256sum -c --ignore-missing blockd-VERSION-shasums.txt -
Extract archive:
Terminal window tar xvf blockd-VERSION-src.tar.gz
Configure
Section titled “Configure”Create data directory and copy a configuration template:
cd blockd-vVERSIONmkdir -p data
cp conf/blockd.example_simple.yml conf/blockd.yml # or conf/blockd.example_tls.ymlEdit conf/blockd.yml and change values for your environment. See Configuration for details.
export NO_COLOR=1docker build -f docker/Dockerfile -t blockd:latest .Docker Run
Section titled “Docker Run”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| Flag | Purpose |
|---|---|
-d | Run as detached (background) process |
--restart unless-stopped | Auto-restart on failure or host reboot |
-v .../blockd.yml:/conf/blockd.yml:ro | Config file, read-only |
-v .../data:/data | Persistent database volume |
-p 21000:21000 | Expose API port |
Docker Compose
Section titled “Docker Compose”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:/dataStart with:
docker compose up -dManage the Container
Section titled “Manage the Container”# View logsdocker logs -f blockd
# Stopdocker stop blockd
# Startdocker start blockd
# Remove container (data volume is preserved)docker rm -f blockd