Senario:
Weblogic container consisted of 3 servers on port 7001, 8001 & 9001. On addition of additional server there was a need to expose and additional port 9002. As port 9002 was not exposed the services over the port ver not exposed externally.
Below is the image of the current state of the container using docker ps command.
We expect to expose the port 9002 without recreating the container.
docker ps
docker stop <contianer-id>
systemctl stop docker
4. Traverse to the directory
cd /var/lib/docker/containers
5. Directory with the name of the container id would be in the above location.
6. Move to the container directory & list the files. There are 2 files that are of our interest.
-rw-r--r--. 1 root root 1689 Jun 6 14:58 hostconfig.json
-rw-------. 1 root root 4903 Jun 6 14:58 config.v2.json
7. Take backup of hostconfig.json & config.v2.json
8. Open the config.v2.json and find the property exposed ports & add the additional port required in the similar format as the existing one.
e.g. - "9002/tcp":{}
systemctl start docker
0 Comments