From 981efba23294aee10b1fcc0d38da4bbbc776f92c Mon Sep 17 00:00:00 2001 From: Jason Yellick Date: Sat, 24 Feb 2018 12:51:54 -0500 Subject: [PATCH] [FAB-8503] Prevent CLI container from exiting The pattern of the byfn scripts and of our tutorial is to start the CLI container, then docker exec commands against it. For some reason, we only start the CLI container with a command of 'sleep 1000' which causes it exit after this time. This causes headaches of having to restart the CLI container and is only saving the overhead of one idle bash process. From a usability it seems far better to leave an idle bash process so that we can be assured the container is still running. Change-Id: I8d5c860b89226a28f15d42f5a19e42b923bfa8c1 Signed-off-by: Jason Yellick --- first-network/docker-compose-cli.yaml | 3 ++- first-network/docker-compose-org3.yaml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/first-network/docker-compose-cli.yaml b/first-network/docker-compose-cli.yaml index 44e45f5d..89f648ab 100644 --- a/first-network/docker-compose-cli.yaml +++ b/first-network/docker-compose-cli.yaml @@ -54,6 +54,7 @@ services: container_name: cli image: hyperledger/fabric-tools:$IMAGE_TAG tty: true + stdin_open: true environment: - GOPATH=/opt/gopath - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock @@ -67,7 +68,7 @@ services: - CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt - CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer - command: /bin/bash -c 'sleep 1000' + command: /bin/bash volumes: - /var/run/:/host/var/run/ - ./../chaincode/:/opt/gopath/src/github.com/chaincode diff --git a/first-network/docker-compose-org3.yaml b/first-network/docker-compose-org3.yaml index f4b3ed25..5bbb3c5a 100644 --- a/first-network/docker-compose-org3.yaml +++ b/first-network/docker-compose-org3.yaml @@ -57,6 +57,7 @@ services: container_name: Org3cli image: hyperledger/fabric-tools:$IMAGE_TAG tty: true + stdin_open: true environment: - GOPATH=/opt/gopath - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock @@ -70,7 +71,7 @@ services: - CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.example.com/peers/peer0.org3.example.com/tls/ca.crt - CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer - command: /bin/bash -c 'sleep 1000' + command: /bin/bash volumes: - /var/run/:/host/var/run/ - ./../chaincode/:/opt/gopath/src/github.com/chaincode