Modify container by config file
Each Docker container has a set of config files associated with it. The parameters of that container, such as Image, Port mapping, would be specified in that file.
The config file is a json file at the location
Get container id.
After stopping the container, the
config.v2.json file can be edited to update the corresponding entry for
PortBindings entry in
hostconfig.json file is also updated.
After making the changes in config files, Docker service is restarted and container is started.