docker pull centos timeout on windows 8.1 - windows

When I run from command line
docker pull centos
I got timeout error. I have no proxy and try from different networks and stucked on this. What reason can be?

Since you wrote that you use Windows 8 I assume that you run boot2docker?
Can you first verify that you can connect to boot2docker itself? E.g. with docker ps? If you still get timeouts issuing that command, make sure boot2docker is running by typing boot2docker restart.
If you can connect to boot2docker without any problems and the docker pull centos problem remains then it seems you have other kind of networking problems on your site which block your connections.

Related

Connecting Docker Windows WSL Ubuntu to VMware Ubuntu

I am trying to connect my Windows 10 Home system to be able to run full Linux OS Docker containers. I have installed Docker on both WSL Ubuntu 18.04 as well as a VMware Ubuntu 18.04.
I was trying to follow this guide.
However, I get stuck trying to configure the Daemon as per the instructions.
Can’t use Docker for Windows?
This is only necessary if you are NOT running Docker for Windows!
No problem, just configure your Docker daemon to use -H tcp://0.0.0.0:2375 and --tlsverify=false. Then you can follow along with the rest of this guide exactly.
If you go down this route, I highly recommend rolling your own VM with VMware Player instead of using the Docker Toolbox because VirtualBox has crazy edge case shared folder bugs that will ruin your life at some point. Don’t worry, VMware Player is free. Just Google how to set up Ubuntu 16 server on VMware Player.
When I try to change the Docker Daemon by making a daemon.json file I get errors. I've also tried editing the .profile files and the .bashrc as per other guides (another guide), with no luck.
I am unable to check the DOCKER_HOST variable on the VM Ubuntu.
Don't make things complicated. In your case, why WSL if you just want to connect to a remote daemon? Why not simply use the windows docker client?
Setup you favorite local VM with docker.
Example: I have installed a CentOS distro running on local VMWare Workstation. All Hyper-V of course deinstalled/deactivated.
In this VM, enable tcp access for the daemon.
If you have a systemd linux distro (like mine CentOS), execute this:
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo echo '[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H unix:// -H tcp://0.0.0.0:2375' >> /etc/systemd/system/docker.service.d/options.conf
sudo systemctl daemon-reload
sudo systemctl restart docker`
Test if the port is open with docker info. You should get an API access warning at the bottom result.
Download the Windows docker cli zip from here: https://download.docker.com/win/static/stable/x86_64/
Move the docker.exe to any folder, for ex. your Documents folder.
Then put this folder path into your Windows PATH variable.
Set the docker host: Open PowerShell, execute setx DOCKER_HOST <VM-IP>:2375 and close it.
Open a new PowerShell and call docker info.
You should see the docker and daemon infos.
Do what ever you like now... :-)

Cannot find Jupyter Notebook server on port 8888 (Windows 10)

I'm trying to run a Docker container as a Jupyter Notebook on Windows 10. As shown in the screen grab, the notebook appears to be running on localhost:8888, but my browsers (Chrome and Edge) return a 'connection refused' error. I've disabled my firewall (temporarily), but that didn't help. Also, netstat does not list the port as being in use. Any idea what's going on?
Try the following:
docker run -p 8888:8888 -it simonwalkersamuel/bloch_tf:latest
-p 8888:8888 will map container port 8888 to host port 8888.
TLDR make sure you mapped the ports using -p 8888:8888. If didn't work, try 192.168.99.100:8888 instead of localhost:8888.
Situation:
I had a slightly different problem: Although I mapped the ports using -p 8888:8888, I still see the connection error when I try to reach localhost:8888 in all browsers. The firewall is checked and seems OK. It was very confusing because exactly same docker image works on my other Win 10 laptop at work.
Solution:
I have two slightly different Win 10 on my laptops. The one that has connection difficulty runs a Win 10 Home whereas the other one has a Win 10 Professional. This means, the problematic laptop only runs Docker Tools not the conventional Docker CE. Therefore, it maps communicates with the OS using 192.168.99.100 IP not the usual 127.0.0.1 or localhost. So, instead of localhost:8888 just used 192.168.99.100:8888 and it worked.
Confession!
I usually use my work laptop for running Jupyter on docker. Therefore, I did not pay enough attention to the welcome message of Docker Quickstart Terminal which clearly says docker is configured to use the default machine with IP 192.168.99.100. Hopefully, this post helps other too busy (aka careless!) people like me!
Since both laptops have very similar apps installed, I doubt anything rather than the Docker app itself causes the difference in IP addresses.
Try the following commands:
run these two command
pip install --upgrade pip
pip install --upgrade jupyter

Docker can not run on Windows 10 linux child system

I just install the Windows 10 Anniversary update which has a new feature that linux child system. So I try to run docker in Windows 10 ubuntu bash(linux child system). Why I want to install docker in linux child system is because:
Windows 10 native docker 1.12 need Hyper-V, but Vmware couldn't run if Hyper-V enable. I have a lot images created by Vmware, it isn't so easy to switch to Hyper-v
I don't want to use Docker Toolbox, it need install VirtualBox, just redunant.
apt-get is fine, docker install success, but fail to start.
$ sudo service docker start
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
* Starting Docker: docker [ OK ]
$ docker ps
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
I have seen this post can-you-run-docker-natively-on-the-new-windows-10-ubuntu-bash-userspace, some people says that it is no posible to run docker in such linux child system, but there also some contrary opinions.
So, I want to ask is there any way to walk around this? Or I have to wait MS update this child system(since it is still beta now).
You have two Problems in there:
the linux child system does not provide the upstart service like e.g. ubuntu. You can work around this by running the docker deamon directly in foreground with docker daemon ...
This does nearly shure not work because docker requires features of the linux kernel like namespaces and capabilities. I don't think the NT-Kernel does implement such exotic features.

Running Boot2Docker on windows, can't connect to the VM ip

I can't make Docker run the Hello-world or any of server-connection things, as you can see it gives me the client version but at the time of giving me the server version it just can't connect...
I have boot2docker 1.7.0 and running on Windows 7.
This looks like your Boot2Docker VM is not running. The docker command tries to connect to the Boot2Docker VM through this IP and port, and it looks like it can't access this IP/port combination. I get a similar error (although not in Spanish) when I try to run docker version without starting Boot2Docker first.
Can you go through the steps listed in the Docker documentation again:
Run the Boot2Docker Start shortcut from your Desktop or “Program Files → Boot2Docker for Windows”. The Start script will ask you to enter an ssh key passphrase - the simplest (but least secure) is to just hit [Enter].
When doing this, do you see the environment variables printed like in the following screenshot?
Do you see these variables, or do you see any error messages instead?

boot2docker on windows - Can't access exposed port

I've installed boot2docker (full install) on Windows 7 and am trying to run the container port redirection demo:
docker run --rm -i -t -p 80:80 nginx
Which looks like it isn't quite finishing properly, it just stops and looks like this:
When I open another git bash shell and run boot2docker ip I get 192.168.59.103, and when I pop that in chrome I get Error code: ERR_CONNECTION_TIMED_OUT
It works fine for me with plain docker on Ubuntu 14.04. What else do I need to do to make it work with boot2docker on windows?
Looking more closely, my problem is the same as this question: Docker, can't reach “rails server” development from localhost:3000 using docker flag -p 3000:3000
The answer to that question that worked for me was this one, which simply says to run
boot2docker ssh -L 8080:localhost:80
at the terminal before starting boot2docker
In my case I do this (from a git bash terminal):
boot2docker init # from https://github.com/boot2docker/boot2docker
boot2docker up
boot2docker ssh -L 8787:localhost:8787 # sets up port forwarding and starts boot2docker
docker run -d -p 8787:8787 cboettig/rstudio # starts the container I want
then go to my web browser in windows and point it to http://localhost:8787/ and I get a server instance of RStudio. When I'm done:
docker rm -f $(docker ps -a -q) # delete all containers
UPDATE: downgrading to an earlier version of VirtualBox will fix this
After struggling with folder sharing I regressed through previous versions of VirtualBox and found that with version 4.3.12 I could enable folder sharing and have the port forwarded exactly according to the official instructions, that is I could access my docker container at 192.168.59.103. So downgrading VirtualBox is another option for working around this problem.
ANOTHER UPDATE: updating to the new release of v1.3.1 of boot2docker will fix this
This release just came out a week ago and includes VirtualBox Guest Additions, which simplifies all of this. I now simply do
boot2docker ssh # start boot2docker
docker run -d -p 8787:8787 -v /c/Users/foobar:/home/rstudio/foobar rocker/rstudio
And I get everthing working as expected and can log into RStudio in my browser at http://localhost:8787/ (linux) or http://192.168.59.103:8787 (Windows) and it just works.
In this case I've also got folder sharing working with, /c/Users/foobar corresponding to an existing folder on my computer at C:/Users/foobar, and foobar can be anything. With this method I can read and write files both ways between Windows and RStudio and I don't need to connect to a special IP address like the samba method does in the official docs
I had this problem too after a couple of failed attempts to boot2docker start. This created multiple entries of host-only networks configured on VirtualBox (VirtualBox Host-Only Ethernet Adapter #2, VirtualBox Host-Only Ethernet Adapter #3), and probably the boot2docker's VM was using a bad one.
I cleaned up using Virtualbox standard UI, leaving only one of the networks and now everything works fine.
I'm using boot2docker 1.5.0.
Just to register something that happened to me, and made me lose a couple of hours.

Resources