I run a docker on my machine
When i want to acces to my docker http://127.0.0.1:8888
i have error
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"]
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!
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With