Run netflixoss Docker on Windows 8.1 - docker

I have installed docker-toolbox v1.12 locally on a Windows 8.1 laptop.
As suggested here I have run docker run -d --name exhibitor netflixoss/exhibitor:1.5.2. This has pulled all the images in my Docker VM "home". docker inspect <<container-id>> (container id obtained from docker ps command) reveals my Network Settings as below.
"NetworkSettings": {
"Bridge": "",
"SandboxID": "c1a16c1704f76b2e2a35b2ae6a18780aaedac078cceb005b419cafb405b1e3b2",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"2181/tcp": null,
"2888/tcp": null,
"3888/tcp": null,
"8080/tcp": null
},
"SandboxKey": "/var/run/docker/netns/c1a16c1704f7",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "3e19d6c6eeb2e7c9dbb9b357ac4ecc9515bdf391df6688f17420bb9443ce3d22",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:02",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "85b5af82cb891978b6d3272f622c747fa68546d0401a24e85c9d42f7644ea2d4",
"EndpointID": "3e19d6c6eeb2e7c9dbb9b357ac4ecc9515bdf391df6688f17420bb9443ce3d22",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:02"
}
}
}
I'm trying to invoke the running Docker container from Windows host using "http://172.17.0.2:8080/exhibitor/v1/ui/index.html". But that doesn't seem to work. docker ps suggests the container is up
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
NAMES
1a849df14320 netflixoss/exhibitor:1.5.2 "java -jar exhibitor-" About an hour ago Up About an hour 2181/tcp, 2888/tcp, 3888/tcp, 8080/t
cp exhibitor
Also I can connect to the container using docker attach 1a849df14320 and see the following log entries time-to-time
INFO com.netflix.exhibitor.core.activity.ActivityLog Cleanup task completed [pool-2-thread-93]
I'm a complete newbie with Docker.

You have not exposed the port to the host.
docker ps -a should give output similar to:
0.0.0.0:1234->9876/tcp, 0.0.0.0:4321->7890/tcp
This shows port 1234 on the host is mapped to 9876 in the container.
Your docker ps output has no port mappings. You should do:
docker run .......... -p 8080:8080
You can always use the -P flag too (if you expose the port in the Dockerfile) but the above solution is the quickest.

Related

Jenkins on docker won't run on port 8080

I have 'docker desktop' installed on my windows 10.
so, I pulled in Jenkins image from docker hub and then run the commands:
docker pull jenkins/jenkins
docker volume create jenkins_home
docker run --name jenkins -p 8080:8000 -p 50000:50000 -v C:/Users/myusername/Documents/jenkins_home:/var/jenkins_home jenkins/jenkins
On console, everything was ok, and get the password for the admin user.
So after that I run
docker start jenkins
and then
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
36683f39dd31 jenkins/jenkins "/sbin/tini -- /usr/…" 6 minutes ago Up 2 minutes 8080/tcp, 0.0.0.0:50000->50000/tcp, 0.0.0.0:8080->8000/tcp jenkins
Now, I need to log into http://localhost:8080/ port to view the Jenkins web app. But did not bring up Jenkins app. I also tried using docker inspect to get the container's ip, but port 8080 didn't work on those ips as well.
"NetworkSettings": {
"Bridge": "",
"SandboxID": "19504b4695ca4dfc9c4af41c9a7ef90115004af07d0099ffed33f4838155cddb",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"50000/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "50000"
}
],
"8000/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "8080"
}
],
"8080/tcp": null
},
"SandboxKey": "/var/run/docker/netns/19504b4695ca",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "f1938dad37524b58d3146f8bfffa4964687d1946ab97b3ae7f0105ced3f64ddf",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:02",
"Networks": {
"Aliases": null,
"NetworkID": "b285258a51bc4877fa9ff8a1928eced061f61a4f92f54a5aa756a118e0f1cb7b",
"EndpointID": "f1938dad37524b58d3146f8bfffa4964687d1946ab97b3ae7f0105ced3f64ddf",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:02",
"DriverOpts": null
}
}
NOTE: Before running jenkins, I made sure the port wasn't busy.
netstat -aon | findstr 8080
After kenkins running, the command shows me
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 25076
TCP [::]:8080 [::]:0 LISTENING 25076
If I find the process to use this port, I got this
tasklist | findstr 25076
com.docker.backend.exe 25076 Console 2 22.664 K
so, Which ip address do I use to see the Jenkins app that is running in the container? and why the localhost on port 8080 doen't work ?

Windows Docker Container has no NAT IP Address. Cannot access container locally

First to be clear, my docker container has an IP address under NetworkSettings.Networks.bridge. That IP is 172.17.0.2
However I cannot access the container via http://172.17.0.2:3000/ after running it with docker run -p 3000:3000 node:8.10.0
My research shows its rough working with docker locally on windows. In following this short guide: https://blog.sixeyed.com/published-ports-on-windows-containers-dont-do-loopback/
I come across using the network NAT IP address. I see this recommended a few places. But that section of my docker inspect does not exist at all.
It returns:
"NetworkSettings": {
"Bridge": "",
"SandboxID": "0c81d8f7ce5bcba70ec0487bbfe91bc6f221e29d9378c33708fac78d0ae47d3e",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"3000/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "3000"
}
]
},
"SandboxKey": "/var/run/docker/netns/0c81d8f7ce5b",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "bbe5f42a5b53c001bd3c2852bc6b22976fb9bab2afcb88b30f6660d7662f526f",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:02",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "0af66a62bc57ce25491c82f5a13d947ca79f5a879f3c1a6db40a90233eeb04f8",
"EndpointID": "bbe5f42a5b53c001bd3c2852bc6b22976fb9bab2afcb88b30f6660d7662f526f",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:02",
"DriverOpts": null
}
}
As you can see the NAT section is missing entirely. I cant find anything online that mentions why or how to resolve. I was hoping it missing would be a good thing and make it easier to connect. Alas it does not. Any help is appreciated. Here is the dockerfile:
FROM node:8.10.0
WORKDIR /app
COPY package.json /app
RUN npm install
COPY . /app
CMD ["./node_modules/gulp/bin/gulp.js", "assets"]
CMD [ "node", "app.js" ]
EXPOSE 3000
That's a known bug under docker windows. It is fixed in 19.03. So try updating your docker engine.

How to enable IPv6 in docker compose version: >= 3?

I need to enable both IPv4/IPv6 dualstack support for my docker containers. My docker compose file is version 3. By default IPv4 is enabled but how do I enable IPv6 for my docker containers/network?
I have already tried to update the docker daemon by updating the daemon.json and I know the updates are being recognised because Docker will not start if there are errors in the file. I have restarted Docker (not just my containers) after making the changes, but still no IPv6 addresses for my containers.
I have discovered that enable_ipv6: true in the docker compose file is not valid for version 3 or greater and I would not like to downgrade by file version.
My updated daemon.json:
{
"ipv6": true,
"fixed-cidr-v6": "2001:db8:1::/64"
}
When I inspect my containers, after making changes to the daemon.json, with docker inspect {id} I see the following:
"NetworkSettings": {
"Bridge": "",
"SandboxID": "df737362d15722fc1b0501ac256ba371417fe513dede807f2a17bd0524630a31",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"9000/tcp": null
},
"SandboxKey": "/var/run/docker/netns/df737362d157",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"healixportal_default": {
"IPAMConfig": null,
"Links": null,
"Aliases": [
"php-fpm",
"9b8a7aee156b"
],
"NetworkID": "5523ae0a4a936b47f212f0e301b64cbbad1f279a33107ed1f624e28d2df96c66",
"EndpointID": "880e13b64bec3fc84ae5a0abb5054bda66d5f439da6853f3538eb33be14b256b",
"Gateway": "172.18.0.1",
"IPAddress": "172.18.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:12:00:02",
"DriverOpts": null
}
}
}
So there is still no IPv6 address assigned to my container...
According to this issue for the compose repo IPv6 is not supported like that yet, but there is a workaround that might do the trick for you:
You must comment enable_ipv6: true, and leave all the others parameters as the documentation says.
After running:
$ sudo docker-compose build
Then execute:
$ docker network create --driver bridge --ipv6 --subnet fd15:555::/64 --subnet 172.16.238.0/24 containerName-dockerfile_app_net --attachable
$ sudo docker-compose up -d

Docker-toolbox cannot access VM by IP

I run: docker run -p "9999:80" nginx and attempt to access the web server using the following address: 172.17.0.2:9999. I got this IP from docker inspect [container_id]:
"NetworkSettings": {
"Bridge": "",
"SandboxID": "877eb750a0f35037f0b9dff2b6bd95f7dd4aaf80ae0ed8cf65e20ad8aeb85132",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"80/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "9999"
}
]
},
"SandboxKey": "/var/run/docker/netns/877eb750a0f3",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "2599dc8c2311725e9816fc30e60a86550cb42887871a921365e3df866427464e",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:02",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "ffc037f862047b118824b8d322aab771ba75a009881959461be577ffebb42a80",
"EndpointID": "2599dc8c2311725e9816fc30e60a86550cb42887871a921365e3df866427464e",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:02",
"DriverOpts": null
}
}
}
But this doesn't work as expected. If I ping 172.17.0.2 from the host I get no response.
Any ideas what's going wrong? It's so much hassle with docker-toolbox because my version of Windows 10 isn't supported by docker.
Since you launched the container with docker run -p 9999:80, you can reach it on the VM's IP address on the public port 9999. docker-machine ip will tell you that IP address (but it is usually 192.168.99.100). So try http://192.168.99.100:9999/ as a URL to reach the container.
The container-internal IP addresses aren't especially useful. One significant problem with them is that they can't be reached from other hosts. In the case of a Docker Toolbox environment, everything Docker-related actually runs inside a virtual machine, and your host system counts as "other hosts" for this. Also note that if you do have occasion to use it (or more often use inter-container DNS for one container to reach another by its docker run --name) you need the port the server is listening on inside the container, not the published port: from another container you might use http://nginx_container_name:80/.

Docker Toolbox for Windows, Container is not accesible on the host

I am new and working on Docker on my Windows Machine. I got toolbox installed on my machine well and ran a container, see below:
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cea8e6cf92b5 seqvence/static-site "/bin/sh -c 'cd /usr…" 21 minutes ago Up 21 minutes 0.0.0.0:32769->80/tcp, 0.0.0.0:32768->443/tcp competent_goodall
Now, this is a Linux container running on a Oracle VM on my windows machine. After this I expect to do a http://172.17.0.2:32769 on my windows machine and get a web page running on Ngnix server.
Here is the container inspect:
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "81d64a885b80a000f3b91e9959acf125b170b7acb11a918bf77bf7fa3fea3ae1",
"EndpointID": "6cf13c7007539f0b31c6d8da52844477f13e1debd84a8f3e2ec63ee140e90014",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:02",
"DriverOpts": null
}
I am not sure if any more details would be needed to understand the problem, so please feel free to let me know.
I think you should try either of the following,
http://localhost:32769
http://(ipv4 of your windows machine):32769

Resources