docker 9 docker的容器命令
有镜像才能创建容器,这是根本的前提 下面我们以下载一个centos镜像来做演示。 [root@t-docker chenzx]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE [root@t-docker chenzx]# docker pull centos Using default tag: latest latest: Pulling from library/centos 256b176beaff: Already exists Digest: sha256:6f6d986d425aeabdc3a02cb61c02abb2e78e57357e92417d6d58332856024faf Status: Downloaded newer image for centos:latest [root@t-docker chenzx]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE centos latest 5182e96772bf 3 weeks ago 200MB 以交互式方式启动容器 功能:新建并启动容器 参数 --name='容器新名字':为容器指定一个别名; -d:后台运行容器,并返回容器ID,也就是启动守护式容器; -i:以交互式模式运行容器,通常与