I am making my own Dockerfile with glassfish5. The glassfish5 has been download from the official web page http://download.oracle.com/glassfish/5.0/release/glassfish-5.0.zip
. I have unzipped this file in the same folder with Dockerfile.
My Dockerfile looks as below:
FROM ubuntu
RUN apt-get update
RUN apt install openjdk-8-jre -y
ADD glassfish5 /opt/
EXPOSE 4848 8080 8181 9009
After that, I am building the image and opening with docker run -it gf5_web
. Here I am going inside the path /opt/glassfish4/glassfish/bin
and running the command ./asadmin start-domain
. The response I am getting is:
Waiting for domain1 to start ...
Successfully started the domain : domain1
domain Location: /opt/glassfish4/glassfish/domains/domain1
Log File: /opt/glassfish4/glassfish/domains/domain1/logs/server.log
Admin Port: 4848
Command start-domain executed successfully.
However, when I try to open it from my local browser through localhost:4848
it doesn’t respond.
What am I possibly doing wrong?