Exposing service minikube and obtain ERR_CONNECTION_RESET - docker

I'm working with minikube and docker (hyper-v), and
I'm trying to expose a service with the command:
minikube service
But when I try to open the web page I obtain the following return:
ERR_CONNECTION_RESET
I link the screenshot of the launched command

Related

How to access NodePort in Minikube with docker driver?

I launched minikube with the docker driver on a remote machine and I have used a nodePort service for a particular pod. I believe nodePort exposes the port on the minikube docker container. On doing minikube IP it gave me the IP of the docker container in which minikube runs. How can I port map the port from the minnikube container to the host port so that I can access it remotely. A different approach would other than using driver=none or restarting minikube is appreciated as I do not want to restart my spinnaker cluster.
There is a minikube service <SERVICE_NAME> --url command which will give you a url where you can access the service. In order to open the exposed service, the minikube service <SERVICE_NAME> command can be used:
$ minikube service example-minikube
Opening kubernetes service default/hello-minikube in default browser...
This command will open the specified service in your default browser.
There is also a --url option for printing the url of the service which is what gets opened in the browser:
$ minikube service example-minikube --url
http://192.168.99.100:31167
You can run minikube service list to get list of all available services with their corresponding URL's. Also make sure the service points to correct pod by using correct selector.
Try also to execute command:
ssh -i ssh -i ~/.minikube/machines/minikube/id_rsa docker#$(minikube ip) -L *:30000:0.0.0.0:30000
Take a look: minikube-service-port-forward, expose-port-minikube, minikube-service-documentation.

Jenkins running in Docker Container but unable to launch it on browser

I have docker installed on Google cloud and I have pulled the Jenkins image from Docker Hub to my docker. Now when I am running a container with Jenkins image using below mentioned command its showing "INFO: Jenkins is fully up and running". But when I tried it on a browser with "http://cloud_external_ip:port" it is not getting opened. It's throwing the message: "This site can’t be reached".
docker container run -p 80:80 --name myjen jenkins
have you tried to check your firewall-rules from the Cloud Shell, for example:
$gcloud compute firewall-rules list | grep 80
then if you need to setup new rule:
$gcloud compute firewall-rules create default-allow-http --allow tcp:80
for more info you can take a look at Google Doc
The Jenkins default port is 8080. You can find out all the ports mapped in your docker using:
$ docker ps -l
or only for one container:
$ docker port myappname
and in the results you need to search for Jenkins and ExposedPorts, and looks similar to this:
“ExposedPorts”: {
“8080/tcp”: {}
},
If you didn't change the default port for Jenkins and you was using this documentation during the installation it's possible that your Jenkins is working on 8080 port.
After check your ports if you want/need to change it in Jenkins you have two options:
by command: java -jar jenkins.war --httpPort=80
Modifying Jenkins config file: /PATH/jenkins, search for HTTP_PORT, and you add your selected port: HTTP_PORT = 80
You need to restart the service after modify the parameter.
If you want to use the port 8080 make sure that you have the correct firewall rules in GCP for this port. You can use the commands appointed by #J.Rojas.
If you're running a web app inside a docker container then before browsing it into the web browser you'll need to do PORT MAPPING.
Instead of running
docker run jenkins
Run this
docker run -p 8080:8080 jenkins
This will map your localhost to the internal IP of the container and you can access the application easily.
To change the port you can do:
docker run -p 8356:8080 jenkins
It can be accessed on port 8356.
Thanks

Openshift (oc) login to registry keeps on failing - how to start the Docker daemon?

After starting a command prompt, I normally start with login in to openshift with this command:
$ oc login https://api.starter-us-west-1.openshift.com
--token=
Works fine. Up till now I then connected to the docker registry of Openshift with the command:
$ docker login -u myOpenShiftName -p registry.starter-us-west-1.openshift.com (or :443)
Now I get this error (partly translated):
Warning: failed to get default registry endpoint from daemon (error
during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.37/info:
open //./pipe/docker_engine: The system cannot find the specified
file. In the default daemon configuration on Windows, the docker
client must be run elevated to connect. This error may also indicate
that the docker daemon is not running.). Using system default:
https://index.docker.io/v1/
Do I need a local docker running?
UPDATE/ANSWER: yes. On windows10 home start e.g. DockerQuickstartTerminal.
At another computer I had a similar error on Windows 10 pro with Docker. The service was started, but after I had started "Docker for Windows" the error disappeared.
My environment is Win10 home, virtual box + extension + docker toolbox.
The docker command cannot work without its local Docker daemon process running.
If you want to be able to work with OCI/Docker images and not need docker and the daemon, for some things you can use a tool like Skopeo.
https://github.com/containers/skopeo
There are also tools for building OCI container images which aren't dependent on docker.

Userland proxy error when launching docker image on Google Cloud Platfrom

I am trying to run a standard nginx container on one of my GCP VMs. When i run
docker run -it --rm -p 80:80 tiangolo/uwsgi-nginx-flask:python3.6
I get the following error:
Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use
However it is a clean VM instance I created. During VM creation I also checked the http port to make sure port 80 is open (i need to add https - but this is my first deployment test).
The image does work locally. It seems to be a Google Cloud Platform configuring thing I guess.
it was my own stupid error.. sorry for asking the SO community...
so what did I do wrong.. I connected through the web client.. which means port 80 is already in use. causing all this havoc :(
so just ssh in and try again and it works.
I tried to reproduce the issue on my end, but I did not find any error. Here are the below steps I have taken.
First I spin up a Debian vm instance in the Google cloud platform and allowed incoming http in the firewall for that VM instance so that I could access the site from outside.
Then I installed docker in the VM instance. I followed this link.
After that, I made sure that http port is free in the VM instance. I used the below command.
netstat -an | egrep 'Proto|LISTEN'
You may check the link here.
At this point, I issued the docker command you provided.
docker run -it --rm -p 80:80 tiangolo/uwsgi-nginx-flask:python3.6
I did not get any error and I could access the nginx page.
“Hello World from Flask in a uWSGI Nginx Docker container with Python 3.6 (default)”
If you spin a new VM with the same docker version, do you have the same issue? What kind of image is your VM running?

Not able to access files in xampp htdocs installed in ubuntu docker container

I have installed xampp and deployed my php code in a docker image and started a container on ubuntu 14.04.
I cannot access my phpmyadmin by using my docker container system ip/phpmyadmin in host computer's firefox browser , but cannot take my web interface in browser. while try to access my web interface its shows as follows:
Access forbidden!
You don't have permission to access the requested object. bhla bhla....
Error 403
Note: I have already given required permissions to files in xampp/htdocs folder
Running a new container with sudo docker run -ti ubuntu will not bind any port. The option -p needs to be used to bind host-port from container-port.
See a more detailed answer.
In your case, assuming your web server is running on port 80 in the container and assuming you cant to access it from you host web browser on the port 9090 start the container with the command:
docker run -it -p 9090:80 ubuntu

Resources