天天看点

Centos7安装Docker及运行hello-world

  • 官网安装参考手册:https://docs.docker.com/install/linux/docker-ce/centos/
  • yum安装gcc相关
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就会停止运行,容器自动终止。

    Centos7安装Docker及运行hello-world
  • run干了什么
    Centos7安装Docker及运行hello-world

本文来自博客园,作者:兮动人,转载请注明原文链接:https://www.cnblogs.com/xdr630/p/14070906.html