参考 http://blog.csdn.net/zhaoliang1131/article/details/54896276
1,安装docker 参考 ubuntu安装docker
2,拉取镜像:
docker pull yeasy/hyperledger-fabric-base:latest \
docker pull yeasy/hyperledger-fabric-peer:latest \
docker pull yeasy/hyperledger-fabric-orderer:latest \
docker pull yeasy/hyperledger-fabric-ca:latest \
docker pull yeasy/blockchain-explorer:latest \
docker tag yeasy/hyperledger-fabric-peer hyperledger/fabric-peer \
docker tag yeasy/hyperledger-fabric-orderer hyperledger/fabric-orderer \
docker tag yeasy/hyperledger-fabric-ca hyperledger/fabric-ca \
docker tag yeasy/hyperledger-fabric-base hyperledger/fabric-baseimage \
docker tag yeasy/hyperledger-fabric-base hyperledger/fabric-ccenv:x86_64-1.0.0-snapshot-preview
3,查看image
> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hyperledger/fabric-orderer latest 52645891d01a 8 days ago 1.06GB
yeasy/hyperledger-fabric-orderer latest 52645891d01a 8 days ago 1.06GB
hyperledger/fabric-peer latest ca7a2a22885c 8 days ago 1.08GB
yeasy/hyperledger-fabric-peer latest ca7a2a22885c 8 days ago 1.08GB
hyperledger/fabric-baseimage latest 9618e74f9dd9 8 days ago 1.03GB
hyperledger/fabric-ccenv x86_64-1.0.0-snapshot-preview 9618e74f9dd9 8 days ago 1.03GB
yeasy/hyperledger-fabric-base latest 9618e74f9dd9 8 days ago 1.03GB
yeasy/blockchain-explorer latest bf3724240f97 11 days ago 636MB
hyperledger/fabric-ca latest 1c82b3bbe885 2 weeks ago 853MB
yeasy/hyperledger-fabric-ca latest 1c82b3bbe885 2 weeks ago 853MB
4,下载docker-compose-files
git clone https://github.com/yeasy/docker-compose-files.git
没有装git的同学可以直接到 https://github.com/yeasy/docker-compose-files 下载
docker-compose-files/hyperledger_fabric/中包含了各种版本的fabric,我们选择latest测试
6, 到 docker-compose-files/hyperledger_fabric/latest 目录测试
这个目录里面有很多配置文件,比如:
docker-compose-1orgs-1peers-dev.yaml
docker-compose-2orgs-4peers-couchdb.yaml
docker-compose-2orgs-4peers-event.yaml
docker-compose-2orgs-4peers-kafka.yaml
docker-compose-2orgs-4peers-solo-be.yaml
docker-compose-2orgs-4peers-solo.yaml
看名字就知道,分别拉起的是什么样的集群。
7,拉起一个fabric集群,2orgs-4peers:
docker-compose -f docker-compose-2orgs-4peers-couchdb.yaml up
8,如果内网机器要部署fabric,可以用一台外网机器按以上步骤获取镜像,然后在导出。步骤如下: