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):

  • docker-compose volumes not mounting to host directories
  • Docker: Running multiple applications VS running multiple containers
  • Is it possible to use Gitlab and WordPress container linked to only one Mariadb container?
  • How to play a docker run --rm with docker-java?
  • how to use docker-compose and maven snaphot dependencies from external repos
  • Change system date time in docker containers without impacting the host
  • 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).

  • Customise apache.conf - set Timeout
  • How to commit changed data in a mysql container to a new image
  • How to use windows authentication with SQL server docker container
  • How can I modify Docker's internal IP on a Mac?
  • error: database is uninitialized and MYSQL_ROOT_PASSWORD not set
  • non-loading with www dir, nginx, nette - set nginx path?
  • 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.