No connectivity between EC2 instance and Docker container - docker

I have an EC2 instance (Ubuntu 16.04 ami-ba602bc2) deployed. I've installed docker on it and downloaded a Docker container that runs JasperReports in Tomcat. I've tested this Docker container on my laptop and it works correctly. I downloaded and started the Docker container on the EC2 instance with
docker run -itd -p 8080:8080 dwschulze/jasperreports.server.v7.1.ubuntu.16.04:latest
the same command I use locally to run on my laptop. docker ps shows the container running. I've opened port 8080 in the AWS security group.
I've also connected to the Docker container and verified that the tomcat instance is running.
I can't connect to the reports server from the internet. I've also tried telnet localhost 8080 from the EC2 instance and it times out.
Everything I've read says that I should be able to run a Docker container on an EC2 instance, but it can't even connect locally.
Any ideas?
Thanks.

My problem was that I was running in a t2.small which is too small to even run Tomcat (let alone Jasper Reports) reliably. I switched to a t2.xlarge and problem solved.

Related

Cloudflare WARP VPN not working with docker on Ubuntu

I have installed warp-cli on ubuntu successfully. Everything works fine except docker. When I run a docker container like docker run -p 9000:8000 docker/image the container is not accessible on localhost:9000.
Thanks!

Docker container deployed in Linux environment

This is what I'm trying to do. I have created a docker container and have it deployed in my Linux Putty environment. I am now trying to view the website I deployed on my Windows Chrome browser. When I try accessing localhost upon running the container, I am getting "This site can't be reached". Below is the command I used to run the container:
docker run -d --name testContainer -p 80:80 static-app:v1
Any advice on how I can access this would be helpful.
I am assuming these two words as
1- Linux putty environment: Linux VM running on windows( oracle etc..) you connected this through putty
2- website I deployed on my Windows Chrome browser: trying to access container through chrome as port is exposed
if above mentioned case is correct then:
port exposed is between host and container is 80:80, here host mean where your docker is running, in your case its Linux environment. you can not see that on windows chrome browser.
Specify if the situation is different.

Unable to access Jenkins container outside of host network

I am stuck in a step. I am using an ubuntu vm which is in Azure cloud through terminal; don't have UI access. There I have installed docker and pulled the jenkins image. I have mapped this container from my host machine by running following command - docker run -p 8080:8080 jenkins to access this jenkins from my MAC using Ubuntu IP address:8080, however I am getting the This site cannot be reached. So do I am following or missed any steps to mapped the container outside of docker host machine? Please help!

docker images access issue

Im not able to access my docker image. my setup is windows 7 and have the docker linux vm which is running on oracle vm. i have build my app and i can see my app using below
i dont know how i can access myapp container. since its wokring on localhost i believe i can access on localhost:port number. but i have no clue where i can see and how i can start. if you have face this same prob can you help ?
Update log hung :
in the below screen the server startup hung almost 10 mins and i terminate the process, any idea about this error ?
What you have shown in your screenshot is the image list. So you would first have to docker run your image, binding the application's port exposed by the docker image (with EXPOSE, I'm assuming 8081 for the sake of my example) to the host:
docker run --publish 8081:8081 3b98
If you forgot to expose the port in your image you can do that on the commandline adding the argument --expose 8081 to run.
Then, since your working with the Windows 7 setup, you cannot access your running application in its container on localhost but on the docker-machine's (the docker linux VM) IP. You can find out the assigned IP with
docker-machine ip
So if your application publishes itself on 8081 and docker-machine ip returns 192.168.99.100 you would find your app on 192.168.99.100:8081

How to get tomcat log from docker container running in atomic host

I am working on Log monitoring, I have requirement of getting tomcat application server logs(example: catalina.log) running in the docker container(container is running in atomic host) and passing it to Logstash server using rsyslog.
I am able to get the docker container related logs, but not able to get the tomcat server and application logs from the docker container where tomcat is running.
Any suggestion on this is appreciated.
Thanks,
Praveen
You could mount the local host when initializing the container. You just pass -v flag for mounting to the local host.
docker run -v /tmp may/hello-world.py
This will allow you to mount the directory of the tomcat logs to the local host.
Here is the Docker Docs that talks about it.
https://docs.docker.com/engine/userguide/containers/dockervolumes/
-Bruce

Resources