docker下 运行centos

1、下载centos iamges

$ docker pull centos

2、查看镜像

$ docker images 
REPOSITORY                                        TAG                 IMAGE ID            CREATED             SIZE
centos                                            latest              9f38484d220f        2 months ago        202MB

3、打开镜像:镜像名称=centos

$ docker run -it centos /bin/bash

4、查看images运行的容器

$ docker container ls

5、退出容器的centos:容器可能会关闭,请参照步骤6再次运行

# exit

6、运行已经停止的容器:容器名称=centos

$ docker start centos

7、进入已经运行的容器

$ docker exec -it centos-01 /bin/bash

8、查看配置文件:容器名称=centos

$ docker inspect centos

posted @ 2019-05-31 01:08  你知道我不是人民币  阅读(3138)  评论(0编辑  收藏  举报