I am using docker to run my java war application and when I run the container I got this exception java.net.BindException: Address already in use .
The container expose port 8085 (8080->8085/tcp) I executed this command to run the docker container :
docker run -p 8080:8085/tcp -d --name=be-app java-app-image:latest
this is screenshot of the error

I checked the opened ports inside the container

I cannot restart the tomcat inside the container because it will stop , I thought about changing the 8085 port in the server.xml file , but I think that I should change the exposed port also. Is there any solution to avoid this exception ? ( java.net.BindException: Address already in use)
