创建容器

[root@6 ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
test-nginx          0.1                 db39aa97fb85        17 minutes ago      109MB
nginx               latest              ae513a47849c        2 weeks ago         109MB
[root@6 ~]# docker create -it nginx:latest
204f49063b1e35c1c4b0a828907da87075b0ab7477b629da7625508200f23131
[root@6 ~]# docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
204f49063b1e        nginx:latest        “nginx -g ‘daemon of…”   4 seconds ago       Created                                 admiring_nightingale
[root@6 ~]# docker start 204f49063b1e
204f49063b1e
[root@6 ~]#
也可以使用docker run 实现新建并启动容器