Docker 之1 -- 轻松启个centos

一、查看docker版本:docker

docker version

二、拉取centos7镜像centos

[root@localhost ~]# docker pull centos:7

三、启动镜像centos7,若是不指定 /bin/bash,容器运行后会自动中止bash

[root@localhost ~]# docker run -d -i -t centos:7 /bin/bash

四、查询docker运行中的容器curl

docker ps -a

五、进入容器url

docker exec -it <CONTAINER ID> bash

<Container ID> 在经过第4步的命令能够查到。centos7

六、看看可否上baiducode

curl www.baidu.com

七、删除容器it

docker container rm  <container ID>
相关文章
相关标签/搜索