CentOS7安装Docker及运行hello-world

324 阅读1分钟
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就会停止运行,容器自动终止。\