Centos 7 install Docker


Install Docker

[root@localhost~]# yum install docker


Start docker service

[root@localhost~]# systemctl start docker.service

[root@localhost~]# systemctl enable docker.service


Install Centos images

[root@localhost~]# docker pull centos

Using default tag: latest

Trying to pull repository docker.io/library/centos ...

latest: Pulling from docker.io/library/centos

6bbedd9b76a4: Downloading 2.531 MB/49.87 MB

fc19d60a83f1: Download complete

de413bb911fd: Download complete

2879a7ad3144: Download complete

668604fde02e: Download complete

668604fde02e: Pulling fs layer


Check Centos images setup status

[root@localhost~]# docker images centos

REPOSITORY          TAG                IMAGE ID            CREATED            SIZE

docker.io/centos    latest              980e0e4c79ec        7 weeks ago         196.7 MB


Run a command in a new container

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

[root@bd1a482d44f5 /]#

help

-i, --interactive               Keep STDIN open even if not attached

-t, --tty                            Allocate a pseudo-TTY

PS:“[root@bd1a482d44f5 /]#” ==>  into centos container

Logout container

[root@localhost~]# exit

exit

全部评论

相关推荐

双尔:你就写拥有ai开发经历,熟练运用提示词,优化ai,提高ai回答质量
点赞 评论 收藏
分享
影04714:把图书管理系统那个项目经验内容适当的减少掉,然后改成据为己有不要说团队项目,因为图书管理系统这类常见的谁来了都能独立写出来,提问能圆过来即可
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
12-10 15:21
华为-媒体院 算法 n*16 硕士985
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务