My Problem is similar to the other two Questions:starting tutorial and Timeout on windows 2016. But none of it resolved my problem. (on my other search I didn't find any articles that could help my case > search timeout)
For any of the following commands:
docker run hello-world
docker pull hello-world
docker login -u user -p pass
I get the same error:
My proxies are correctly set to my cntlm service:
when I try to get the address with curl I get the following answer:
My docker version:
Docker info:
I've tried all the troubleshoot from this link (create a new default docker machine and so on)
Do you have any idea what could I do to download hello-world (or other) container?
Finally I got it:
First of all the client should be the same Version as the Server (now both are 1.13.1)
Second because I am using a Cntlm I have to create a Tunnel to forward my port from the Cntlm configuration.
ssh -R tunnelPort:proxy-Cntlm docker#ip.docker.machine
where:
tunnelPort will be used on the docker-machine (ex: 3000 for 127.0.0.1:3000)
proxy-Cntlm is the ip + port from cntlm.ini (ex: 127.0.0.1:3128)
ip.docker.machine it can be found simply by running docker-machine ls
One more thing! you have to adjust the ~/.ssh/config (at least for cygwin)
Host docker 192.168.99.100
Hostname 192.168.99.100
IdentityFile "path/to/id_rsa"
#on windows it is C:/Users/user/.docker/machine/machines/default/id_rsa when you have a default Machine
Related
I have recently installed docker toolbox for windows 10 home. I downloaded the jboss/wildfly image from the docker hub. I tried to create the container with the following command.:
docker run -p 8080:8080 -p 9990:9990 -it jboss/wildfly /opt/jboss/wildfly/bin/standalone.sh -bmanagement 0.0.0.0. The server appears to be up and running. I got the IP address for my host using docker-machine ls which gave me an IP address of 192.168.99.100. When I type the following into my MS Edge browser http:\\192.168.99.100:8080\ instead of getting the wildfly welcome page I get “Cannot Reach This Page” error (HTTP 404?). I have tried this with the Tomcat server and have the same problem. Thanks.
Looking at the build file on the docker registry, I would try http://127.0.0.1:9990 or http://192.168.99.100:9990
Ref: https://hub.docker.com/r/jboss/wildfly
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 just installed Docker with Docker-Toolbox on my Mac using homebrew: install docker with homebrew
After creating and configuring a Container with Rails, Postgres and starting docker-compose up everything looks fine but i can't access the webserver from host.
The output of
$ docker-compose up
dummy_1 | I, [2016-03-30T14:55:53.130639 #6] INFO -- : listening on addr=0.0.0.0:8000 fd=10
When i type in Google Chrome the url http://0.0.0.0:8000/ i get
This site can’t be reached
0.0.0.0 refused to connect.
ERR_CONNECTION_REFUSED
So i tried
$ docker-machine env dummy
with the following output:
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="/Users/choi/.docker/machine/machines/dummy"
export DOCKER_MACHINE_NAME="dummy"
When i try in Chrome http://192.168.99.100:2376 i get a blank file downloaded. Why is it so? I expect the default greeting page of my Rails App.
192.168.99.100 is the IP of your Docker host, in this instance. You need to expose the port of your container and then you will be able to connect to it from the outside world.
I'm not familiar with Docker Compose, but the log you have posted suggests port 8000 is exposed. Try, therefore, http://192.168.99.100:8000.
(The reason http://192.168.99.100:2376 doesn't work is because that's the address and port of the Docker daemon itself, which isn't HTTP-based. As for 0.0.0.0: This is the address which your web server is listening on inside the container and equates to all external connections therein. However, without any ports exposed, there's no way in!)
For those who tried localhost:4000 as the tutorial said but failed:
Input this:
$ docker-machine env
and you will see something like:
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="/Users/choi/.docker/machine/machines/dummy"
export DOCKER_MACHINE_NAME="dummy"
So you get the IP: 192.168.99.100. Then just visit 192.168.99.100:4000, as ip:your_port.
You can find a right address to call your page this way
First, find the CONTAINER ID by:
$ docker ps
You will get the information like this:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
56dd4d582b08 abc01 "python app.py" 10 minutes ago Up 11 minutes 80/tcp, 0.0.0.0:80->4000/tcp flamboyant_bell
Now you know the port: 4000 (scroll right this row). So that the address should be like this:
http://192.168.99.100:4000/
However, you can double check:
$ docker port 56dd4d582b08
You will get in this case the following info:
4000/tcp -> 0.0.0.0:80
Now you can try to look you project at
http://192.168.99.100:4000/
After exposed the port, you can access the web app by the internal IP address created by docker. You can get the IP address using the container's name running the command:
docker inspect --format '{{ .NetworkSettings.IPAddress }}' 'container name here'
Let's say that you got the IP 172.17.0.2. You can run open http://172.17.0.2:8000
I'm running under boot2docker 1.3.1.
I have a Docker container running a web server via uwsgi --http :8080.
If I attach to the container I can browse the web site using lynx http://127.0.0.1:8080 so I know the server is working.
I ran my container with:
$ docker run -itP --expose 8080 uwsgi_app:0.2
It has the following details:
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5248ad86596d uwsgi_app:0.2 "bash" 11 minutes ago Up 11 minutes 0.0.0.0:49159->8080/tcp cocky_hypatia
$ docker inspect --format '{{ .NetworkSettings.IPAddress }}' 5248ad86596d
172.17.0.107
I thought I could access that web site from my host by going to http://172.17.0.107:49159.
This does not work. I just see 'connecting...' in Chrome, getting nowhere.
What am I doing wrong?
Extending Anentropic's answer: boot2docker is the old app for Mac and Windows, docker-machine is the new one.
Firstly, list your machines:
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM
default * virtualbox Running tcp://192.168.99.100:2376
Then select one of the machines (the default one is called default) and:
$ docker-machine ip default
192.168.99.100
Ok, stupid me, I found the answer in the docs for boot2docker
https://docs.docker.com/installation/mac/#container-port-redirection
I needed to use the ip address of the boot2docker vm, rather than the ip of the container, i.e.
$ boot2docker ip
192.168.59.103
and I am able to browse my site from the host at http://192.168.59.103:49159/
I did not need to add any route on the host
To find the IP address of your container, you should need NO additional installs:
docker inspect <container>
This provides a wealth of info. grep it for the IPAddress.
You could use boot2docker port mapping option -L, as described here.
So, in your case it would be
boot2docker ssh -L 0.0.0.0:8080:localhost:8080
and then
docker run -it -p 8080:8080 uwsgi_app:0.2
That way, you do not have to use boot2docker's IP address: you can use localhost or your own IP address (and your docker container can be accessed from outside).
Boot2docker is outdated, but you may still have this problem on Docker for Windows or Mac, even though the same container works on Linux. One symptom is that trying to access a page on the server inside the container gives the error "didn't send any data" as opposed to "could not connect."
If so, it may be because on Win/Mac the container host has its own IP, it's not localhost as it is on linux. Try running Django on IP 0.0.0.0, meaning accept connections from all IPs, like this:
python manage.py runserver 0.0.0.0:8000
Alternatively, if you need to make sure the server only responds to local requests (such as from your local proxy like nginx, apache, or gunicorn) you can use the host IP returned by hostname -i.
And make sure you are using the -p port forwarding option correctly in the docker run command.
Assuming all is well, you should be able to access your server at http://localhost in a browser running on the host machine.
docker build -t {imagename} .
docker build -t api-rest-test .
docker run -dp {localport}:{exposeport} image:name
docker run -dp 8080:8080 api-rest-test:latest
make sure you are using the same port for yourlocalport and exposeport
then you can access your rest service in your local machine http://localhost:8080
[EDIT: original version was ignoring the -P in question]
If you want to get to the containers without having to 'publish' the port (which changes its number)
there is a good run-through here.
The key is this line:
sudo route -n add 172.17.0.0/16 172.16.0.11
which tells the Mac how to route to the private network inside the VirtualBox VM that the Docker containers are on.
Had the same issue and in my case i was using AWS EC2 instance. I was trying with the container IP which did not work. Then I used the actual public IP of the AWS host as the IP, which worked.
How to troubleshoot the issue on hosting application on local host browser
For this launch the container with below command, in my case it was:
[root#centoslab3 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1b81d8a0e3e1 centos:baseweb "/bin/bash" 8 minutes ago Exited (0) 24 seconds ago webtest
[root#centoslab3 ~]# docker run --name=atul -v /root/dockertest:/var/www/html -i -t -p 5000:8000 centos:baseweb /bin/bash
In the httpd configuration:
[root#adb28b08c9ed /]# cd /etc/httpd/conf
[root#adb28b08c9ed conf]# ll
total 52
-rw-r--r--. 1 root root 34419 Sep 19 15:16 httpd.conf
edit the file with the port 8000 in listner and update the container ip and port under Servername.
Restart the httpd service and you are done.
Hope this helps
I just installed Docker on mu Ubuntu 14.10 64 bit OS and I followed the steps to create the necessary certificates and keys so that I can secure my docker http remote connections. When I tried to issue the following command,
sudo docker --tlsverify --tlscacert=ca.pem --tlscert=cert.pem --tlskey=key.pem -H=x.x.x.x:2376 version
I get to see the following error message:
Cannot connect to the Docker daemon. Is 'docker -d' running on this host
The -H=x.x.x.x is the host as I see when I did a ifconfig and found the host from the docker0 entry that was listed.
Please help me identify why I'm not able to do anything with my daemon.
Did you change the options on the daemon itself? Paraphrasing the docs:
You can listen on port 2376 on all network interfaces with -H tcp://0.0.0.0:2376, or on a particular network interface using its IP address: -H tcp://192.168.59.103:2376.
To do this you could edit /etc/init/docker.conf and update the DOCKER_OPTS variable
Sometime ago i had this issue :
"Cannot connect to the Docker daemon at tcp://127.0.0.1:2376. Is the docker daemon running?"
Looking an your question, you did not specify if you are working on Ubuntu WSL (Bash).
Regardless of your env configuration.
Looking for the file ".bashrc" in your
add the following to it
export DOCKER_HOST=tcp://192.168.59.103:2376
Happy Devops!