connected host has failed to respond when I run `docker run hello-world` in docker - windows

The lastest version of docker(version 0.6) has been installed in my laptop (windows 10 LTSB) through the installation package docker toolbox. It seems to be installed correctly cause I see the logo of docker when I started the docker quickstart terminal. While when I run docker run hello-world, it returns
$ docker run hello-world
D:\Program Files\Docker Toolbox\docker.exe: An error occurred trying to connect: Post https://192.168.99.100:2376/v1.24/containers/create: dial tcp 192.168.99.100:2376: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond..
See 'D:\Program Files\Docker Toolbox\docker.exe run --help'.
By the way, I open the vpn through cisco anyconnect. However, when I disconnect the vpn and run the hello world, it seems to just froze at
$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c04b14da8d14: Pulling fs layer
What happened? Can you find what's wrong with the docker or vpn?

You should first create a default machine (or start if already created):
docker-machine create default
Then get the environment commands for your new VM:
docker-machine env
And then connect your shell to the new machine:
eval "$(docker-machine env default)"
After then docker run hello-world is expected to work fine. I tested on Windows 10Pro with Docker-Toolbox

Related

Can't connect from outside of container to Clickhouse by HTTP on Mac OS

I'm trying to use ClickHouse with docker on Mac OS. I use next command:
docker run -d -p 8123:8123 --rm --name some-clickhouse-server -v /my/config/path/config.xml:/etc/clickhouse-server/config.xml --ulimit nofile=262144:262144 yandex/clickhouse-server:latest
Container successfully started, but when I try to connect to it by http curl 'http://localhost:8123' I have an error:
Failed to connect to localhost port 8123: Connection refused
When I connect to Clickhouse from Clickhouse-client (also using docker image) everything is OK
I ran Clickhouse-server image in -it mode, installed curl, started server and tried to connect clickhouse-server from inside of container, it's OK too
Also I tried to modify config.xml (which was copied from docker image) settings for listen_host (::, 0.0.0.0, ::1, 127.0.0.1)
and for every setting I tried to connect by curl for localhost, 127.0.0.1, 0.0.0.0 - nothing of this solved my problem
Normally, docker desktop write these details of host and container to /etc/hosts, after adding the clickhouse-service as follows has resolved this issue.
127.0.0.1 localhost clickhouse-service
I used Docker Toolbox on Mac OS (in conjunction with VirtualBox). So, I've migrated to Docker Desktop and this has solved my problem

docker daemon not connecting

I am new to docker. On Mac OSX I installed docker and docker-machine and ran the following based on what I saw elsewhere online and on stackoverflow. Why is the daemon not connecting? Do I need to change my config to unix sockets for communications? Did I start my docker daemon correctly via docker-machine?
docker-machine create --driver virtualbox default
...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running
on this virtual machine, run: docker-machine env default
..
docker run debian echo "Hello World"
docker: Cannot connect to the Docker daemon at
unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.
To see how to connect your Docker Client to the Docker Engine running
on this virtual machine, run: docker-machine env default
The command you're missing is eval "$(docker-machine env default)" which will update your environment with $DOCKER_HOST and $DOCKER_TLS_VERIFY settings you can use to connect to the daemon.
One possible reason could be change in your IP address.
simply restart the docker (click on the right-top of your screen a docker-whale). Then again try to run the docker. Use Docker desktop app for mac

Docker pull images No such host error on mac osx

I recently installed latest docker on my mac and i'm getting following error on pulling images.
First I install latest docker form mac binary and then i run
docker run -d -p 80:80 --name webserver nginx
And it return
ERROR: Service 'nginx' failed to build: Error while pulling image:
Gethttps://index.docker.io/v1/repositories/library/nginx/images: dial tcp:
lookup index.docker.io on ***.***.**.*:**: no such host
How can i fix this ?
After some days research I can't get the actual solution so i did one trick and worked for me. what i done is I open the docker preferences and there is a option reset to factory defaults and i reset my docker but it deletes all my containers and images after all it works. Thanks everyone.

Docker and Windows - Problems with SSH on default container

i'm new to Docker and i've just intalled Docker ToolBox 1.11.1 on my Windows 7 (64 bit).
When running Quickstart Terminal i've got problems with creating default container.
After reading a bunch of forums i've invoked :
docker-machine rm -f default
docker-machine --debug create -d virtualbox default
But still without result. Full logs from last operation are :
https://gist.github.com/anonymous/117e302c047492170a6f0c7d4e79199a
They end up with phrase :
"(default) DBG | Error dialing TCP: dial tcp 127.0.0.1:49659: connectex: No connection could be made because the target machine actively refused it."
I've have no idea how to fix that. Can someone help me ?
In windows and Mac OS Docker run in a virtual machine. When you install Docker using the Docker Toolbox, it takes care of install Virtual Box, create a “default” virtual machine and configure it to run a Boot2Docker image.
With the command:
docker-machine rm -f default
you are removing this default VM. Then running the command:
docker-machine --debug create -d virtualbox default
you are creating a new VM called “default”, so you are not creating or starting any default windows container.
"Actively refused it" means that the host sent a reset instead of an ack when you tried to connect. Please, check the firewall or the proxy configuration because this is a communication problem.
Hope this can help.

Can't connect to Docker containers on OSX

I'm new to Docker, and I can't seem to connect to any containers.
I installed Docker Toolbox. Now I'm trying to get Shipyard to work. I followed the steps inside of a Docker Quickstart Terminal. The instructions say:
Once deployed, the script will output the URL to connect along with credential information.
The Shipyard installer ended with:
Shipyard available at http://10.0.2.15:8080
Username: [elided] Password: [elided]
However, I went to http://10.0.2.15:8080 on my browser and it didn't connect.
In another Docker Quickstart Terminal, I did a docker ps to see what the container was and to get its IP Address and I got:
$ docker inspect a4755 | grep IPAddress
"SecondaryIPAddresses": null,
"IPAddress": "172.17.0.8",
"IPAddress": "172.17.0.8",
I'm not sure why the IP was different, but I tried to connect to http://172.17.0.8:8080 and this didn't work either. http://localhost:8080 also failed.
This also happened when I tried to run docker-gunicorn-nginx - everything started, but I couldn't connect to the machine.
What gives?
If you read through Docker's Installation on Mac OS X you'll see that on OSX, Docker containers don't run on the host machine itself:
In a Docker installation on Linux, your physical machine is both the localhost and the Docker host. In networking, localhost means your computer. The Docker host is the computer on which the containers run.
On a typical Linux installation, the Docker client, the Docker daemon, and any containers run directly on your localhost. This means you can address ports on a Docker container using standard localhost addressing such as localhost:8000 or 0.0.0.0:8376.
[...]
In an OS X installation, the docker daemon is running inside a Linux VM called default. The default is a lightweight Linux VM made specifically to run the Docker daemon on Mac OS X. The VM runs completely from RAM, is a small ~24MB download, and boots in approximately 5s.
In OS X, the Docker host address is the address of the Linux VM. When you start the VM with docker-machine it is assigned an IP address. When you start a container, the ports on a container map to ports on the VM. To see this in practice, work through the exercises on this page.
Indeed, opening a new Docker Quickstart Terminal, I see:
docker is configured to use the default machine with IP 192.168.99.100
And, opening http://192.168.99.100:8080 takes me to Shipyard. Success!
You can try and execute this command:
docker-machine ip default
it will return some thing like:
192.168.99.100
To get port number:
docker ps
Example output (scroll right to see port mapping):
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
113346425f20 springio/spring1 "sh -c 'java $JAVA_OP" 34 minutes ago Up 34 minutes 0.0.0.0:8080->8080/tcp pensive_kirch
To verify if it is working do:
curl 192.168.99.100:8080

Resources