方法1
- stop running container
1docker stop test01
- commit the container
1docker commit test01 test02
NOTE: The above,
1test02is a new image that I’m constructing from the
1test01container.
- re-run from the commited image
1docker run -p 8080:8080 -td test02
方法2
- stop running container
- find docker container in the file system
- In Linux, it’s most likely here
1/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
1/etc/init.d/docker restart
- start your container
近期评论