title: How do I link my Orderer and Peers to the Fabric-CA using docker
body: <p>I am following the Hyperledger fabric-ca <a href="http://hyperledger-fabric-ca.readthedocs.io/en/latest/users-guide.html#getting-started" rel="nofollow noreferrer">getting started</a> guide and working with Hyperledger Fabric alpha2.</p>
  
  <p>Here is what I would like to do:</p>
  
  <ul>
  <li>Start the fabric-ca</li>
  <li>Connect the orderer and the peers to the fabric-ca using the credentials I previously created</li>
  <li>And later, only allow authorized <strong>user</strong> to call the chaincode and access to their attributes</li>
  </ul>
  
  <p>I started my fabric-ca server, registrered a new Identity (peer for example) and enrolled it. A msp directory was generated with the keystore, signcerts, cacerts.
  The fabric-ca msp directory et ca-cert.pam were also generated.</p>
  
  <p>To start the orderer, I use this command:</p>
  
  <pre><code>docker run -it --name orderer.example.com -p 7050:7050 
  -v $DIR/crypto-config/.../orderers/orderer.example.com:/var/hyperledger/orderer/msp 
  -v $DIR/orderer.block:/var/hyperledger/orderer/orderer.block 
  -w /opt/gopath/src/github.com/hyperledger/fabric
  -e ORDERER_GENERAL_LOGLEVEL=debug 
  -e ORDERER_GENERAL_LISTENADDRESS=0.0.0.0 
  -e ORDERER_GENERAL_GENESISMETHOD=file 
  -e ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.block 
  -e ORDERER_GENERAL_LOCALMSPID=OrdererMSP 
  -e ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp 
  hyperledger/fabric-orderer 
  </code></pre>
  
  <p><strong>How can I start my orderer and peers and tell them to "connect" to the fabric-ca using docker? Which environment variable should I use ?</strong> I just don't really understand how the communication work between these entities.</p>