Base image for a Hyper Ledge Fabric client compiled to run on a Raspberr Pi.
151
This image has a pre-compiled configuration with fabric-sdk-py v0.8.0 of Hyper Ledger Fabric for Raspberry Pi. The purpose is to delivery a easy way to start running a blockchain client in a Rapberry Pi environment without needing to concern with the whole compilation process.
During the build process, a Python virtual environment was copied with the fabric-sdk-py and it's dependencies. The following Dockerfile and docker-compose.yaml shows the steps needed to start an application with this image:
docker-compose.yaml
version: "3.8"
services:
blk-client:
container_name: blk-client
image: prnascimento/blockchain-client-base:1.0.0
build: .
volumes:
- ./:/usr/src/app
deploy:
resources:
limits:
cpus: '0.70'
memory: 20M
Dockerfile
FROM prnascimento/blockchain-client-base:1.0.0 as base-fabric
RUN groupadd -g 999 python && \
useradd -r -u 999 -g python python
RUN mkdir /usr/src/app && chown python:python /usr/src/app
WORKDIR /usr/src/app
USER 999
WORKDIR /usr/src/app/<volume-mapped-directory>
ENV PATH="/usr/src/venv/bin:$PATH"
CMD ["/usr/src/venv/bin/python3", "<your-application.py>"]
In this Dockerfile <volume-mapped-directory> is the mapped application directory on the host, and <your-application.py> is the Python script to run.
After configuring the files docker-compose.yml and Dockerfile, execute the following command to build and run the container:
docker-compose up --build
Content type
Image
Digest
Size
383.8 MB
Last updated
over 4 years ago
docker pull prnascimento/blockchain-client-base:1.0.0