I have the following for a docker file...
FROM openjdk:11-jdk-slim
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Dexternal.config.active='false'","-jar","/app.jar"]
And spring config...
docker {
springBootApplication {
baseImage = 'openjdk:11-jdk-slim'
ports = [9090, 8080]
tag = 'app:0.2'
}
}
Everything seems to start file and I see
Started Application in 8.743 seconds (JVM running for 9.153)
and I see...
f46b4cbfa799 646eced45077 "java -jar /app/simp…" 15 minutes ago Up 15 minutes 8080/tcp, 9090/tcp mystifying_kirch
But when I run docker inspect <imageId> | grep "IPAddress"
and enter that address in the browser like this http://<IP>:8080
I get a timeout error. I know I can use the port mapping on run but is there a way I can do it without mapping to my localhost?
Also I tried this...
curl 172.17.0.2:8080
curl: (7) Failed to connect to 172.17.0.2 port 8080: Operation timed out
So it isn't the browser.
Also tried to map it like this...
0.0.0.0:8080->8080/tcp, 9090/tcp
But localhost:8080 (or the ip address) sends an empty response " didn’t send any data."