方法1
- stop running container
docker stop test01 - commit the container
docker commit test01 test02NOTE: The above,
test02is a new image that I’m constructing from thetest01container. - re-run from the commited image
docker run -p 8080:8080 -td test02 
方法2
- stop running container
 - find docker container in the file system
- In Linux, it’s most likely here
/var/lib/docker/containers/ - In Mac, follow this document
 
 - In Linux, it’s most likely here
 - Update “PortBindings” in hostconfig.json, and “ExposedPorts”, “Ports” in config.v2.json or config.json
 - Restart docker daemon
/etc/init.d/docker restart - start your container
 
近期评论