Deploying the local host in tomcat docker - docker

I need to run already running localhost in my system into tomcat docker. I have used the command, tried to add the localhost into container mygit(tomcat being hosted here)
docker run --hostname=http://10.132.200.76:1000/ -d -p 8082:8080 --name mygit tomcat

Related

Cannot access application running inside a docker container

I'm running a centos image in a docker container and in this container, I did run an application on port 3000. When I access the application on my local machine (localhost:3000) I cannot access.
This is the command that I'm using:
docker run --rm -it -v /home/victor/Documentos/doc:/usr/src/app -p 3000:3000 centos bash
Application running
ensure that the application bind to 0.0.0.0 and not 127.0.0.1.
You can check using docker ps command
https://stackoverflow.com/a/54942153/4087989

Jenkins docker running in the container but not launching in web browser

On my Redhat7linux docker host, i have created a jenkins container by pulling the jenkins official image from docker hub and i was able to bring the jenkins container up & running by executing the command:
docker run -d -p 50000:8080 -v $PWD/jenkins:/var/lib/jenkins -t jenkins_master
and i could see the jenkins is up when i checked the logs using the docker logs {containerID} but when i try to launch it in web browser with {hostip}:50000, I couldn't access it as it throws "The site cant be reached", and since my container is running inside a company network, should I either open/enable that port 50000 or do I need to set any proxy in the docker host?
Am I missing something here?
Here are the outputs of the docker command:
The official image provide the following command :
docker run -p 8080:8080 -p 50000:50000 -v /your/home:/var/jenkins_home jenkins
It seems that both ports 8080 and 50000 have to be exposed.
Execute the docker run command to run the container, check the status of your container.
docker container run -p [YOUR PORT]:8080 -v [YOUR
VOLUME]:/var/jenkins_home
--name jenkins-local jenkins/jenkins:lts
you can then access it using localhost:[YOUR PORT]

Cannot connect to docker container webapp from different system

If I run my docker container as
docker run -ti --privileged=true -p 5010:5000 myapp
I cannot connect to myapp by https://:5010
But if I run my docker container as
docker run -ti --privileged=true -p 5000:5000 myapp
I can connect to myapp by https://:5000 from different machine
What can be the issue? What option should I use to map container port to host port with different number?
output of nestat
Interestingly I can connect to my web server from same machine by wget command
This is the output of the netstat -ln when my docker is running.
This has been finally identified as firewall issue and the ports can be accessed if the firewall rule is changed.

Accessing localhost of a docker container from the host

I am running the cloudera docker quickstart image (on windows) as explained on the this page.
I run it using:
docker run --hostname=quickstart.cloudera --privileged=true -t -i -p 7180:7180 -p 9080:9080 cloudera/quickstart:latest
It runs fine, I am able to run cloudera manager and access it using the url http://192.168.99.100:7180. So far so good. I also use tomcat with a simple app on localhost:9080 inside this same container. How do I access it on my host? I tried using http://192.168.99.100:9080 but it does not work.
Update: I fixed it by using the vm ip i.e. 192.168.99.100 instead of localhost for the server. Now it works. Thanks.

Docker in Docker: Port Mapping

I have found a similar thread, but failed to get it to work. So, the use case is
I start a container on my Linux host
docker run -i -t --privileged -p 8080:2375 mattgruter/doubledocker
When in that container, I want to start another one with GAE SDK devserver running.
At that, I need to access a running app from the host system browser.
When I start a container in the container as
docker run -i -t -p 2375:8080 image/name
I get an error saying that 2375 port is in use. I start the app, and can curl 0.0.0.0:8080 when inside both containers (when using another port 8080:8080 for example) but cannot preview the app from the host system, since lohalhost:8080 listens to 2375 port in the first container, and that port cannot be used when launching the second container.
I'm able to do that using the image jpetazzo/dind. The test I have done and worked (as an example):
From my host machine I run the container with docker installed:
docker run --privileged -t -i --rm -e LOG=file -p 18080:8080
jpetazzo/dind
Then inside the container I've pulled nginx image and run it with
docker run -d -p 8080:80 nginx
And from the host environment I can browse the nginx welcome page with http://localhost:18080
With the image you were using (mattgruter/doubledocker) I have some problem running it (something related to log attach).

Resources