I have installed Docker toolbox with docker version, Docker version 18.03.0-ce, build 0520e24302. I have created an image and start the container and publish the port 8899:8899.
The issue is, when I stopped the toolbox and restart my laptop and after that when i opened my toolbox and run the below command:
docker container ls
The container shows active but while accessing the service inside the container on a browser, shows no response and no connection.
Troubleshooting I did:
I checked the port inside the container, I got the below result:
root@4d40ccddaed1:/# ss -lnpa
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
nl UNCONN 0 0 0:0 *
nl UNCONN 0 0 0:2533 *
nl UNCONN 4352 0 4:74 *
nl UNCONN 768 0 4:0 *
nl UNCONN 0 0 6:0 *
nl UNCONN 0 0 10:0 *
nl UNCONN 0 0 12:0 *
nl UNCONN 0 0 15:0 *
nl UNCONN 0 0 16:0 *
u_str ESTAB 0 0 * 22094 * 0 users:((“java”,pid=1,fd=26))
*tcp LISTEN 0 100 :8899 : users:((“java”,pid=1,fd=25))
It seems peer port is missing. That means, when i am shutting down my toolbox and my laptop the port is broken and when i starting my laptop and toolbox again container is not able attach to the same port to the toolbox.
Please, advise how to attach the port again to the same container without creating a new container.
I tried using:
docker run -i --expose =
but it is creating a new container which I don’t want.