docker create container(创建容器并运行)

Docker创建容器并运行。Create a new container,run a command in a new container.

docker create [OPTIONS] IMAGE [COMMAND] [ARG...]

$ docker create -t -i fedora bash

or

$ docker create -t -i centos bash

or

$ docker create -t -i ubuntu bash

docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

$ docker run -it -d ubuntu

or

$ docker run -p 127.0.0.1:80:8080/tcp ubuntu bash
9aa88c08f319cd1e4515c3c46b0de7cc9aa75e878357b1e96f91e2c773029f03

$ docker exec -it 9aa88c08 /bin/bash