CentOS7安装Docker及运行helloworld

  • 官网安装参考手册: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就会停止运行,容器自动终止。
原文地址:https://www.cnblogs.com/xdr630/p/15255007.html