I am new in using docker and I am trying to implement SWARM according to this tutorial -
https://docs.docker.com/get-started/part4/#create-a-cluster
The tutorial starts with -
Launch Hyper-V Manager
Click Virtual Switch Manager in the right-hand menu
Click Create Virtual Switch of type External
I am using Windows 10 PRO and I cannot use Hyper-V Manager and Docker terminal at the same time. Because if I activate Hyper-V and then start docker terminal, my PC shows an error and shut down automatically.
So, I tried to create a virtual machine without Hyper-V by following code
$ docker-machine create -d hyperv --hyperv-virtual-switch "myswitch" myvm1
and as expected I got this error -
Wrapper Docker Machine process exiting due to closed plugin server (connection is shut down)
Error with pre-create check: "read tcp 127.0.0.1:50588->127.0.0.1:50587: wsarecv: `An existing connection was forcibly closed by the remote host."`
So, is there any alternative solution how can I proceed or to use Hyper-V Manager in Windows 10 without such problem.
Thanks a lot for your time :)
Virtualbox and Hyperv don't work together. Since you are using docker quickstart terminal you should be using VirtualBox for the VM
$ docker-machine create -d virtualbox swarmanager1
$ docker-machine create -d virtualbox nodes1
$ docker-machine create -d virtualbox nodes2
Once done you switch to manager node
$ eval $(docker-machine env swarmanager1)
$ docker swarm init --advertise-addr eth0
This will give you a token command and you need to execute them for each node
$ eval $(docker-machine env nodes1)
$ docker <swarm command from manager>
Related
I am running minikube using the instructions at
https://kubernetes.io/docs/tutorials/hello-minikube/
I started minikube:
$ minikube start --vm-driver=hyperkit
and verified that it is successfully running.
I am running 'Docker Community Edition' version 18.06.1-ce-mac73.
$ minikube ssh
is working fine.
However when I do
$ docker ps
on my mac os host, it doesn't show any containers. However, when I do
$ docker ps
after doing minikube ssh, I see about 20 containers.
So, where are the docker containers really running? Why does docker ps not show any containers on my mac?
Thank you.
You can use the following command to configure your Docker Host address:
eval $(minikube docker-env)
Then, when you run docker ps, you should see your containers. Read more here.
Docker containers are not running on your MAC host.
They are running on a VM where you can do minikube ssh to that VM.
The docker ps shows the containers in there inside that VM.
That's expected because you are using hyperkit driver to work as a hypervisor & launch lightweight virtual machines. Think of it as virtualbox launching VMs for you & complete k8s cluster is deployed into those VMs, all of them are well integrated.
Use below to get your virtual machine address or the server where these containers are actually running -
$ minikube ip
Ref -
https://github.com/moby/hyperkit
Since I can't add a comment:
To revert the change in your shell, use
eval $(minikube docker-env -u)
as answered here: How do I undo the command $ eval "$(docker-machine env blog)"
I used docker with docker-machine ( can access container server by 192.168.99.100 ). I would like not to use docker-machine. so I can directly access my container by localhost (127.0.0.1). I shut down docker-machine (docker-machine stop) and tried to build image and container, but It said 'no daemon'. how should I completely shut down docker-machine and use local docker?
I think what you want is unset all docker-machine environment variables to use you host Docker daemon. This can be achieved with this command.
eval $(docker-machine env -u)
There are two different installs for docker on Mac. Both use a VM running Linux under the covers.
The older method includes docker toolbox and docker machine to manage the VM in virtualbox. When you use docker machine to stop this VM, the docker commands have no host to run on and will error out as you've seen.
The newer install uses xhyve to run the VM and various other tricks to make it appear seamless. This is a completely different install that you download and run from Docker, and it requires your Mac be at least version 10.10.3 with Yosemite.
See this install page for more details: https://store.docker.com/editions/community/docker-ce-desktop-mac?tab=description
I have installed a repo from docker and ran it using the following command,
docker run -d --name searx -p $PORT:8888 wonderfall/searx
The container was also sucessfully created but while accessing it in my browser i get the following error,
dail tcp[::1]:8888: connectex: No connection could be made because the target machine actively refused it.
Does anyone know why this error occurs? I use a windows10 system.
Just installed docker toolbox
That means you cannot use localhost directly without declaring in Virtual Box a port-forwarding rule.
First, test your service using the IP of your VM (see docker-machine ip default output)
http://<ip>:8888
Then, declare a port-forward rule:
either directly in your VirtualBox graphical interface: see "How do I configure docker compose to expose ports correctly?"
or with VBoxManage controlvm commands: see "Not able to access tomcat application on Docker VM with host(windows) IP while using docker toolbox"
I am window user and working fine with the docker on default machine. I can build images and run it perfectly. But now I have scenario where I have to run two docker-machine parallel.
I have created new docker machine from following command:
docker-machine create --driver virtualbox NAMEOFNEWMACHINE
Now when I run docker-machine ls I can see there is two docker machine running.
Then I run docker-machine ip so it gives me the IP of default machine so basically I am not able to switch from default to new dev machine on docker.
I have read docker docs & I run commands which they mentioned to switch the machine
eval "$(docker-machine env NAMEOFNEWMACHINE)"
docker-machine env NAMEOFNEWMACHINE
but after running above command it still shows me default machine ip, Therefor I cannot build my image on new machine
I am pretty new to docker so is there anyone who can help me in how to run two docker machine parallel?
Thanks
Just had the same problem on windows 7. Solved it by setting the windows DOCKER_HOST environment variable. Check your machine ip (docker-machine ls) and use the complete ip in the command:
SET DOCKER_HOST=
docker error when using --log-driver="syslog" on OS X
I am trying to learn how to use docker containers on OS X (10.10.3), I understand the differences with the standard Linux implementation ( need boot2docker VM) and I wonder if there is any impact on the way I can log messages with syslog
when I start a container with the --log-driver="syslog" option, the container is created but I get an error upon start
~$ docker run --log-driver="syslog" --name daemon_dwayne -d ubuntu /bin/sh -c "while true; do echo hello_world; sleep 2; done;"
1f623793049916d5c....
FATA[0000] Error response from daemon: Cannot start container 1f623793049916d5....: Unix syslog delivery error
this is running fine on a Linux machine... thanks for any hint
Boot2docker runs in a small linux VM. By default, syslog isn't running in the VM. You can turn it on by running syslogd in the VM e.g:
$ boot2docker ssh
...
docker#boot2docker:~$ syslogd
If you then try running your container again it should work.
You can make this change permanent by calling syslogd from the file /var/lib/boot2docker/bootsync.sh inside the boot2docker VM, which boot2docker will execute before starting Docker.