1

I am working with Hyperledger Fabric for my job and I'm trying to learn about the network and docker, and I'm following along with this tutorial. I get to the step where I need to enter the CLI container using docker exec -it cli bash but when I enter that, I get the following error:

Error response from daemon: Container ddc2288c83a89c478f9b31b7a3273994ec4767d63e58208c8e4b145ae44b0579 is not running

I get this even after I started the network with docker-compose -f docker-compose-cli.yaml up -d and even enter docker start cli for good measure, which is exactly what the tutorial told me to do.

I can confirm it exits immediately because when I enter docker ps -a into my terminal, it shows all the processes but the cli for some reason exits immediately:

What's causing this? What can I do to fix it? The tutorial says that if CLI exits you just enter docker start cli to initialize it again, but it doesn't work.

Ethan Fox
  • 159
  • 1
  • 15
  • 2
    You cannot enter to container because the current status is Exited according to image, try to see the logs from ```docker logs CONTAINER ID``` – julian salas Feb 23 '18 at 19:18

1 Answers1

1

Solution 1 -

When you start your network with the following command, CLI container will stick around by default for 1000 seconds.

docker-compose -f docker-compose-cli.yaml up -d

so before running this command you will have to set the TIMEOUT variable. To Set the timeout execute the following command before starting your network.

export TIMEOUT=<no of seconds your CLI should stay up>

this way you can ensure your cli stays up as long as you need to execute further commands.

Also if your CLI is not running then simply execute this command to start the CLI.

docker start cli

Solution -2

Before running docker-compose -f docker-compose-cli.yaml up -d command open the docker-compose-cli.yaml` file.

then comment out the following line like this -

#command: /bin/bash -c './scripts/script.sh ${CHANNEL_NAME} ${DELAY}; sleep $TIMEOUT'

Hope this helps.

Anand Soni
  • 186
  • 1
  • 5
  • 1
    Thank you so much for answering this question! Admittedly this is almost a year ago and I've become a lot more proficient with Docker since then so I'm not even sure how to replicate this issue. Hopefully someone in a similar position to me is able to take advantage of this!! – Ethan Fox Dec 17 '18 at 21:18