docker pull centos
docker images
docker run -d -i -p 10000:80 centos
docker ps
爲什麼需要加 -i 的參數:
Nothing is actively running. That makes sense, because we’re not telling the containerized OS to do anything
— it starts, it doesn’t have anything to do, and so it shuts down immediately.
Instead we can tell it to run interactively and with a terminal by specifying a couple options:
-i, --interactive
-t, --tty (“allocate a pseudo-TTY”, i.e. a terminal)
(see docker run --help for details)