- start container
docker run --rm -it -p 8080:8080 --name myapp ankur198/springboot-windows --name myapp java -jar ./opt/app/demo-0.0.1-SNAPSHOT.jar
- get ip
docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" myapp
- open
ip:8080/hello
in your browser
short way
docker run -p 8080:8080 --name myapp ankur198/springboot-windows --name myapp java -jar ./opt/app/demo-0.0.1-SNAPSHOT.jar
$ip = docker inspect -f "{{ .NetworkSettings.Networks.nat.IPAddress }}" myapp
Start-Process 'http://$($ip):8080/hello
See this