Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker image run but nothing on my Chrome

Tags:

docker

I run a docker on my machine

enter image description here

When i want to acces to my docker http://127.0.0.1:8888 i have error enter image description here

Why it's wrong ?

Dockerfile:

FROM tomcat:9-jre8
RUN echo "export JAVA_OPTS=\"-Dapp.env=staging\"" > /usr/local/tomcat/bin/setenv.sh  
# Copy to images tomcat path
ADD /target/*.war /usr/local/tomcat/webapps/myProject.war
EXPOSE 8888
CMD ["catalina.sh", "run"]
like image 893
Aaron Guilbot Avatar asked Nov 29 '19 13:11

Aaron Guilbot


People also ask

Can you run Chrome in a docker container?

Without the display variable we can't run GUI apps inside a container. Now chrome runs inside the container, as we had mentioned DISPLAY variable while launching this container!

How do I open docker container in browser?

To access it, open your web browser and type "localhost:3000" into the address bar. This will take you to the home page of the server. This is how you access the container. Once you get the ip you can access your web app in the browser such as http://<ip of your virtualbox>:8080.

How do I start docker chromium?

Launch from KDE Start Menu: Internet -> Chromium Docker, and after a terminal window flashes on screen and a few seconds pass, Docker will launch with Chromium Media Edition within it.

What to do if docker is not running?

By default, docker container will exit immediately if you do not have any task running on the container. To keep the container running in the background, try to run it with --detach (or -d ) argument.


1 Answers

Tomcat runs http on the port 8080 by default. You should change your mapping to port 8080

for eg. docker run -p 8080:8080 <your image name>

If you want tomcat to run on a port other than 8080 you will need to edit the server.xml and change the port. I will not recommend to do that in the docker container. Rather keep tomcat running on default port and change the port mapping. So if you want the service to be exposed on port 8888 on the local machine then change the mapping to

docker run --publish=8888:8080 -d registry.gitlab.com/myproject/registry:develop

like image 61
Mohit Mutha Avatar answered Oct 21 '22 02:10

Mohit Mutha