I am following official Hyperledger Fabric documentation(Build your first network). When executing docker exec -it cli bash, it is not being executed. There is no response. I cannot use peer command.
docker exec -it cli bash, output:
root#e45419781222:/opt/gopath/src/github.com/hyperledger/fabric/peer#
I cannot enter further commands and it doesn't show any errors. And when I try to use peer command from another terminal, it throws peer command not found.
I think it is not connected to cli container.
I am just starting out with hyperledger. I cannot identify the error and it seems there is no resources regarding this issue.
I expect to connect to the cli container.
Try this command.
docker exec -it cli /bin/bash
Sorry, very dumb mistake even for linux and fabric noobie. I realized you have to write command after "root#e45419781222:/opt/gopath/src/github.com/hyperledger/fabric/peer#". I thought this was end of the execution. And peer command works form this rather than opening new terminal.
Related
I am using Zsh + Docker-for-mac on my work MacBook.
upon startup of a new shell session, I receive the following output from presumably the docker for mac CLI:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I am having a hard time understanding where this initial command to the docker CLI is being initiated from. I have checked all RC files; bash, zsh etc. but cannot find any relevant command invoking to docker CLI.
Is there a way to trace commands executed from RC scripts and the location of those commands to determine where this startup command is defined?
I just installed docker on a Mac (docker toolbox from here; at least I hope to have it installed correctly), but when following the tutorial and type the following command
docker run hello-world
I get the following error:
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
Did I do something wrong? Do I miss some installation steps? Do I miss something that is 'obvious' to the experts, but not to docker beginners like me?
I don't see anything in the instructions that says anything about a 'docker daemon'...
On the shell it says:
docker is configured to use the default machine with IP aa.bb.cc.d
The version command seems to work:
Docker version 17.07.0-ce, build 8784753
Update:
I tried to start the daemon by using the command
sudo dockerd
but all I got was
sudo: dockerd: command not found
Correction: The command works, but only in the sell that opened magically during the installation. The command does not work in any other shell. But when I have to close the shell/restart the computer - what to do then? How to 'start docker???
Maybe there is a tutorial that is complete and working and explains why I need a docker-deacon, how to start it, how to start a docker image or whatever, including the complete terminology for beginners?
Docker Toolbox runs a virtual linux machine on which the docker-daemon runs. To control the virtual machine, you use the docker-machine command. For example docker-machine start to start the machine after you reboot your computer, or docker-machine stop to shut it down.
There is also the docker-machine env command which will set the environment variables needed for docker to work. Check the bottom line of it's output, it shows you how to run the command correctly to set the environment variables. Should be exec $(docker-machine env) on Mac if I'm correct. You need to set the environment variables in each shell in which you want to use docker commands.
Docker for mac starts a linux virtual machine in the background which contains the actual docker stuff. When you start a normal terminal, the terminal is not connected to the vm to execute the docker commands.
The docker quick start terminal is the one that you need to use. This terminal will execute the commands on the VM that is running in the background.
With docker toolbox, if you don't launch your terminal from the docker menu, you'll need to configure your environment separately:
eval "$(docker-machine env default)"
I am new to docker and I tried to run the linuxconfig/lemp-php7 image. Everything worked fine and I could access the nginx web server installed on the container. To run this image I used this command:
sudo docker run linuxconfig/lemp-php7
When I tried to run the image with the following command to gain access over the container through bash I couldn't connect to nginx and I got the connection refused error message. Command: sudo docker run -ti linuxconfig/lemp-php7 bash
I tried this several times so I'm pretty sure it's not any kind of coincidence.
Why does this happen? Is this a problem specific to this particular image or is this a general problem. And how can I gain access to the shell of the container and access the web server at the same time?
I'd really like to understand this behavior to improve my general understanding of docker.
docker run runs the specified command instead of what that container would normally run. In your case, it appears to be supervisord, which presumably in turn runs the web server. So you're preventing any of that from happening.
My preferred method (except in cases where I'm trying to debug cases where the container won't even start properly) is to do the following after running the container normally:
docker exec -i -t $CONTAINER_ID /bin/bash
I am following this Guide at http://kubernetes.io/docs/getting-started-guides/docker/ to start using Kubernetes on MacOS. Is this guide valid?
When I am doing this step:
docker-machine sshdocker-machine active-N -L 8080:localhost:8080
They command is hanging, no repsponse at all;
Looking at docker ps -l, I have
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b1e95e26f46d
gcr.io/google_containers/hyperkube-amd64:v1.2.3 "/hyperkube apiserver"
About an hour ago Up About an hour
k8s_apiserver.c08c1df_k8s-master-127.0.0.1_default_d95a6048198f747c5fcb74ee23f1f25c_d0c6d2fc
So it means kubernete is running
I run this command:
docker-machine `sshdocker-machine active` -L 8080:localhost:8080
I can login to docker machine, then exit, run kubectl get nodes again, hanging, no response
Anything wrong here?
If this step can not pass, how can I use Kubernetes?
"docker-machine ssh docker-machine active -N -L 8080:localhost:8080" sets up a ssh tunnel. Similar to ssh tunnel, you can run that command in the background by passing the -f option. More useful tips here
I'd recommend running the ssh command in a separate terminal, so that it will be easy to bring down the tunnel.
As long as the above command is running, kubectl should work.
I ran docker images and got the following error:
FATA[0000] Get http:///var/run/docker.sock/v1.17/images/json:
dial unix /var/run/docker.sock: no such file or directory.
Are you trying to connect to a TLS-enabled daemon without TLS?
There seems to be no useful message on how to fix the error. What could be wrong?
https://docs.docker.com/installation/mac/
you need to do this once:
boot2docker init
then, everytime you reboot your mac you will need to run :
boot2docker start
That is the command that starts the docker daemon. But, on each shell you want to access it from you will need to run:
$(boot2docker shellinit)
Now you can use the docker client, like:
docker run hello-world
Your docker daemon is simply not running.
Just run service docker start
It may be not a bug. I am facing the same log when run :"boot2docker up -v" command. Then 'eval "$(boot2docker shellinit)" ' just doesn't work on fish but the "boot2docker shellinit" is actually the fish command. Then I switch to zsh, there is some wired output which also has been reported somewhere. Then I switch to bash. I try both 'eval "$(boot2docker shellinit)" ' and "$(boot2docker shellinit)" without eval. Then I found that "boot2docker shellinit" also generates the fish script. Which may give me the answer why it doesn't work at first place. So I copied the three line of fish script and pasted it in the fish shell and now the error log the one you are facing is going even in the bash. I don't really know the reason. Usually the ev on works on the current shell and current session.