Skip to content

Commit 981efba

Browse files
author
Jason Yellick
committed
[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 <jyellick@us.ibm.com>
1 parent c93268f commit 981efba

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

first-network/docker-compose-cli.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ services:
5454
container_name: cli
5555
image: hyperledger/fabric-tools:$IMAGE_TAG
5656
tty: true
57+
stdin_open: true
5758
environment:
5859
- GOPATH=/opt/gopath
5960
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
@@ -67,7 +68,7 @@ services:
6768
- 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
6869
- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp
6970
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
70-
command: /bin/bash -c 'sleep 1000'
71+
command: /bin/bash
7172
volumes:
7273
- /var/run/:/host/var/run/
7374
- ./../chaincode/:/opt/gopath/src/github.com/chaincode

first-network/docker-compose-org3.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ services:
5757
container_name: Org3cli
5858
image: hyperledger/fabric-tools:$IMAGE_TAG
5959
tty: true
60+
stdin_open: true
6061
environment:
6162
- GOPATH=/opt/gopath
6263
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
@@ -70,7 +71,7 @@ services:
7071
- 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
7172
- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp
7273
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
73-
command: /bin/bash -c 'sleep 1000'
74+
command: /bin/bash
7475
volumes:
7576
- /var/run/:/host/var/run/
7677
- ./../chaincode/:/opt/gopath/src/github.com/chaincode

0 commit comments

Comments
 (0)