Search code examples
docker-composehyperledger-fabrichyperledger

Not able to run testNetwork of hyperledger issue in docker-compose


I am following the instructions of https://hyperledger-fabric.readthedocs.io/en/release-2.2/test_network.html to run my first fabric network. as per instructions, have downloaded docker images from

curl -sSL https: bit.ly/2ysbOFE | bash -s

below is screenshot of images downloaded

ashish@ashish-Aspire-E1-570:~/myown/fabric-samples/test-network$ sudo docker images
REPOSITORY                   TAG       IMAGE ID       CREATED        SIZE
busybox                      latest    62aedd01bd85   9 days ago     1.24MB
hyperledger/fabric-ca        1.5       b2aed5002b3d   2 months ago   68.1MB
hyperledger/fabric-ca        1.5.3     b2aed5002b3d   2 months ago   68.1MB
hyperledger/fabric-ca        latest    b2aed5002b3d   2 months ago   68.1MB
hyperledger/fabric-tools     2.4       625237d887db   3 months ago   473MB
hyperledger/fabric-tools     2.4.3     625237d887db   3 months ago   473MB
hyperledger/fabric-tools     latest    625237d887db   3 months ago   473MB
hyperledger/fabric-peer      2.4       ee643d889779   3 months ago   62.3MB
hyperledger/fabric-peer      2.4.3     ee643d889779   3 months ago   62.3MB
hyperledger/fabric-peer      latest    ee643d889779   3 months ago   62.3MB
hyperledger/fabric-orderer   2.4       df64446ac2df   3 months ago   37.3MB
hyperledger/fabric-orderer   2.4.3     df64446ac2df   3 months ago   37.3MB
hyperledger/fabric-orderer   latest    df64446ac2df   3 months ago   37.3MB
hyperledger/fabric-ccenv     2.4       da4f00cb576a   3 months ago   517MB
hyperledger/fabric-ccenv     2.4.3     da4f00cb576a   3 months ago   517MB
hyperledger/fabric-ccenv     latest    da4f00cb576a   3 months ago   517MB
hyperledger/fabric-baseos    2.4       0287ebf8aaf3   3 months ago   6.94MB
hyperledger/fabric-baseos    2.4.3     0287ebf8aaf3   3 months ago   6.94MB
hyperledger/fabric-baseos    latest    0287ebf8aaf3   3 months ago   6.94MB

Docker and docker-compose versions are as below

ashish@ashish-Aspire-E1-570:~/myown/fabric-samples/test-network$ docker-compose --version
docker-compose version 1.20.0, build ca8d3c6
ashish@ashish-Aspire-E1-570:~/myown/fabric-samples/test-network$ docker --version
Docker version 20.10.17, build 100c701
ashish@ashish-Aspire-E1-570:~/myown/fabric-samples/test-network$ 

when I run ./network.sh up command, getting below issue

ashish@ashish-Aspire-E1-570:~/myown/fabric-samples/test-network$ ./network.sh up
Using docker and docker-compose
Starting nodes with CLI timeout of '5' tries and CLI delay of '3' seconds and using database 'leveldb' 
LOCAL_VERSION=2.4.3
DOCKER_IMAGE_VERSION=2.4.3
ERROR: Version in "./compose/compose-test-net.yaml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
ashish@ashish-Aspire-E1-570:~/myown/fabric-samples/test-network$ 

I tried to search this issue and came across,

Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version

As per the suggestions in it, have been trying to install latest docker-compose but not able to find right link. i mean in examples found on internet, they have shown link to download as

sudo curl -L https://github.com/docker/compose/releases/download/1.20.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose

but my observation is latest versions like v2.5.0 are not reachable if i just change the version in above link which I tried as well.

Pls help me understand how I can proceed with this !


Solution

  • I was able to download 2.6.0 as follows

    sudo curl -L https://github.com/docker/compose/releases/download/v2.6.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose