Manually starting hyperledger peers using docker images

The hyperledger project has a built-in docker image definition for running peer nodes. Given the vagrant focused development environment documentation, it’s not immediately obvious that you can set up your own chain network using docker-compose.

To do that, first build the docker image by running this test (this test step is entirely dedicated to building the image):

  • accessing docker private registry
  • Kong API Authentication using Oauth2.0
  • How can I access the Kubernetes service through ClusterIP
  • Can I build Docker contains for a Raspberry Pi on a AMD64 machine?
  • Need to know how to use Groovy to automate a Docker build & runtime
  • WSO2 version 2 docker files
  • go test -run=BuildImage_Peer

    Once the image is built, use docker-compose to launch the peer nodes. This folder has some pre-built yaml files for docker-compose:

    Use the following command to launch 3 peers (for instance):

     docker-compose -f docker-compose-3.yml up --force-recreate -d

    After the container instances are up, use docker inspect to get the IP addresses and use port 5000 to call the REST APIs (refer to the documentation for REST API spec).

  • Can't get localhost to connect to docker inside vagrant
  • mount a folder in docker machine using docker for mac
  • PostgreSQL on AWS ECS: psycopg2.OperationalError invalid port number 5432
  • Containers - What are their benefits, if they can't run across platform
  • Image successfully builds but won't push due to auth credentials
  • Docker Hub - Automatic build on tag with regex match not triggered
  • 3 Solutions collect form web for “Manually starting hyperledger peers using docker images”

    You can look in the hyperledger/fabric github repository under the ./bddtests and ./consensus/docker-compose-files directories for examples on how to setup peer networks of 3, 4 or 5 nodes.

    Remember to expose port 5000 for one of the validating peers so that you can use the REST api to interact with the peer node.

    Now that the Hyperledger Fabric project has published its inaugural release (v0.5-developer-preview), we have begun publishing official Hyperledger docker images for the fabric-baseimage, fabric-peer and fabric-membersrvc.

    These images can be deployed, as noted by other respondents, using docker-compose. As noted above in the response by @tuand, the fabric/bddtests are a good source of compose files that could be repurposed.

    Note that if running on a Mac or Windows using Docker for Mac(beta) that you’ll need to use port mapping to expose ports for a peer, as Docker for Mac does not support routing IP traffic to and from containers. Container linking works as expected. Hence, you will either need to map different ports for each of the peers, or only expose a single peer instance.

    The following compose file will start a single peer node on a Mac using Docker for Mac. Simply run docker-compose up:

    image: hyperledger/fabric-peer
    - "5000:5000"
    command: peer node start

    There are two github repositories that let you build docker images with hyperledger that you can run directly


    Under yeasy there are some repositories that contain fabric deploy scripts.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.