Just something to remember how this works and what it associated with when using a containerized Application such as docker and how it could benefit System Engineering and Administration.
Due to the sake of simplicity, let us use a linux (host) machine called box and with a username as flo. {NameOfYourDockerInstance} is the name of the docker instance you will give on your local machine.
Pulling OS from docker Hub
flo@box: ~ $ docker pull centos # other OS listed on DockerHub
Name your OS instance
flo@box: ~ $ docker run -t -d --name {NameOfYourDockerInstance} centos
Show what is running inside docker
flo@box: ~ $ docker ps
Execute the software inside this Docker instance
flo@box: ~ $ docker exec -it {NameOfYourDockerInstance} bash
Check the status of your docker instances
flo@box: ~ $ docker stats
To Stop/Start Docker Instance
flo@box: ~ $ docker start/stop {NameOfYourDockerInstance}
When and if by chance that you have forgot to add a port to a Docker container. One can search for this file called hostconfig.json in your host OS and make changes to the container you wish to reconfigure. A second approach might be to stop the instance, commit a copy from a source instance to a destination instance then using the run command to finally add the port.
flo@box: ~ $ docker stop cake
flo@box: ~ $ docker commit cake cake2
flo@box: ~ $ docker run -t -d -p 8080:8080 cake2
flo@box: ~ $ docker exec -it cake2 bash