From 331448b78cd41c1e4c55e795b88409db0cabafda Mon Sep 17 00:00:00 2001 From: Bolek Tekielski Date: Wed, 25 Apr 2018 09:27:17 +0200 Subject: [PATCH] Added env var support in docker-compose, updated documentation Signed-off-by: Bolek Tekielski --- chaincode-docker-devmode/.env | 1 + chaincode-docker-devmode/README.rst | 33 ++++++++++++----------------- 2 files changed, 14 insertions(+), 20 deletions(-) create mode 100644 chaincode-docker-devmode/.env diff --git a/chaincode-docker-devmode/.env b/chaincode-docker-devmode/.env new file mode 100644 index 00000000..fe5d18b6 --- /dev/null +++ b/chaincode-docker-devmode/.env @@ -0,0 +1 @@ +TAG=x86_64-1.0.6 \ No newline at end of file diff --git a/chaincode-docker-devmode/README.rst b/chaincode-docker-devmode/README.rst index 40e6a217..9ed4de2c 100644 --- a/chaincode-docker-devmode/README.rst +++ b/chaincode-docker-devmode/README.rst @@ -13,7 +13,7 @@ of compiling chaincode and driving calls. Install Fabric Samples ---------------------- -If you haven't already done so, please install the doc [samples](http://hyperledger-fabric.readthedocs.io/en/latest/samples.html). +If you haven't already done so, please install the `Hyperledger Fabric Samples `_. Navigate to the ``chaincode-docker-devmode`` directory of the ``fabric-samples`` clone: @@ -27,37 +27,30 @@ Download docker images We need four docker images in order for "dev mode" to run against the supplied docker compose script. If you installed the ``fabric-samples`` repo clone and -followed the instructions to [download-platform-specific-binaries](http://hyperledger-fabric.readthedocs.io/en/latest/samples.html#download-platform-specific-binaries), then +followed the instructions to `download-platform-specific-binaries `_, then you should have the necessary Docker images installed locally. -.. note:: If you choose to manually pull the images then you must retag them as - ``latest``. +Hyperledger Fabric does not provide 'latest' tag for the docker images (see `FAB-8338 `_ for reference), which means that one has to specify tag explicitly when pulling the images. -Issue a ``docker images`` command to reveal your local Docker Registry. You -should see something similar to following: +This repository provides default tag via `docker-compose environment variables `_. +The default tag is specified in the `.env <.env>`_ file. + +If you want to use different tag either update `.env <.env>`_ file, or override the TAG variable while running docker-compose. .. code:: bash - docker images - REPOSITORY TAG IMAGE ID CREATED SIZE - hyperledger/fabric-tools latest c584c20ac82b 9 days ago 1.42 GB - hyperledger/fabric-tools x86_64-1.1.0-preview c584c20ac82b 9 days ago 1.42 GB - hyperledger/fabric-orderer latest 2fccc91736df 9 days ago 159 MB - hyperledger/fabric-orderer x86_64-1.1.0-preview 2fccc91736df 9 dyas ago 159 MB - hyperledger/fabric-peer latest 337f3d90b452 9 days ago 165 MB - hyperledger/fabric-peer x86_64-1.1.0-preview 337f3d90b452 9 days ago 165 MB - hyperledger/fabric-ccenv latest 82489d1c11e8 9 days ago 1.35 GB - hyperledger/fabric-ccenv x86_64-1.1.0-preview 82489d1c11e8 9 days ago 1.35 GB + TAG=1.1.0-pre docker-compose -f docker-compose-simple.yaml up -.. note:: If you retrieved the images through the [download-platform-specific-binaries](http://hyperledger-fabric.readthedocs.io/en/latest/samples.html#download-platform-specific-binaries), +.. note:: If you retrieved the images through the `download-platform-specific-binaries `_, then you will see additional images listed. However, we are only concerned with these four. -Now open three terminals and navigate to your ``chaincode-docker-devmode`` -directory in each. +Now Terminal 1 - Start the network ------------------------------ +Open three terminals and navigate to your ``chaincode-docker-devmode`` +directory in each. .. code:: bash @@ -93,7 +86,7 @@ Now run the chaincode: .. code:: bash - CORE_PEER_ADDRESS=peer:7052 CORE_CHAINCODE_ID_NAME=mycc:0 ./chaincode_example02 + CORE_CHAINCODE_ID_NAME=mycc:0 ./chaincode_example02 The chaincode is started with peer and chaincode logs indicating successful registration with the peer. Note that at this stage the chaincode is not associated with any channel. This is done in subsequent steps