1. 程式人生 > >Fabric docker compose檔案-ca

Fabric docker compose檔案-ca

前提

cryptogen生成的檔案放置在./crypto-config內。

compose配置檔案:

docker-compose-ca-orgY.yaml 

version: '2'

services:

#容器名稱

#變數
environment: 

- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server 
- FABRIC_CA_SERVER_CA_NAME=ca-orgY

# docker啟動後啟動一個ca server ,注意修改根證書CA_PRIVATE_KEY和admin密碼

#CA_PRIVATE_KEY: ./crypto-config/peerOrganizations/

orgY.example.com/ca/*_sk的*

#admin密碼:隨意設定

          - FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.orgY.example.com-cert.pem
            - FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/CA_PRIVATE_KEY
            - FABRIC_CA_SERVER_TLS_ENABLED=true
            - FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.

orgY.example.com-cert.pem
            - FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/CA_PRIVATE_KEY

command: sh -c 'fabric-ca-server start -b admin:adminpw -d'

#掛載
volumes:

ports:

- "7054:7054"