Centos7安装Docker及运行hello-world

yum -y install gcc
yum -y install gcc-c++
  • 启动docker:
systemctl start docker
  • 测试:
docker version
docker run hello-world
  • 卸载:
systemctl stop docker 
yum -y remove docker-ce
rm -rf /var/lib/docker

启动Docker后台容器(测试运行 hello-world)

  • docker run hello-world
    输出这段提示以后,hello world就会停止运行,容器自动终止。
    在这里插入图片描述
  • run干了什么
    在这里插入图片描述
世间味趣亦如此,万物且去轮浮生。
原文地址:https://www.cnblogs.com/xdr630/p/14070906.html