[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
[root@localhost ~]# uname -r
3.10.0-1160.el7.x86_64
[root@localhost ~]# docker pull ubuntu
[root@localhost ~]# docker pull centos
[root@localhost ~]# docker images
REPOSITORY   TAG       IMAGE ID       CREATED         SIZE
nginx        latest    605c77e624dd   16 months ago   141MB
redis        latest    7614ae9453d1   16 months ago   113MB
ubuntu       latest    ba6acccedd29   18 months ago   72.8MB
centos       latest    5d0da3dc9764   19 months ago   231MB
[root@localhost ~]# docker run -it 5d0da3dc9764 bash
# -i 交互式操作
# -t 开启一个终端
# bash 解释器
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
[root@localhost ~]# docker run -it ba6acccedd29 bash
root@eeaee4ef8985:/# yum
bash: yum: command not found
root@eeaee4ef8985:/# uname -r
3.10.0-1160.el7.x86_64
root@eeaee4ef8985:/# exit
exit
最后修改:2023 年 06 月 09 日
如果觉得我的文章对你有用,请随意赞赏