一、安装Docker

  1.1、查看原有系统是否已经安装docker
yum list installed | grep docker

  Centos7下Docker的使用

  1.2、如果有则不需要继续安装,想重新安装,先卸载
yum -y remove docker.x86_64
yum -y remove docker-client.x86_64
yum -y remove docker-common.x86_64

  Centos7下Docker的使用

  1.3、删除原来的镜像
rm -rf /var/lib/docker

    Centos7下Docker的使用

  1.4、开始安装
yum -y install docker-io

  Centos7下Docker的使用

  1.5、启动docker
service docker start

  Centos7下Docker的使用

  1.6、加入开机启动
chkconfig docker on

  Centos7下Docker的使用

二、测试(下载一个centos镜像)

  2.1、pull centos 镜像
docker pull centos

  Centos7下Docker的使用

  2.2、查看已经安装的镜像
docker images

  Centos7下Docker的使用

  2.3、启动一个容器
docker run -it centos /bin/bash

  Centos7下Docker的使用

  2.4、查看所有容器
docker ps

  Centos7下Docker的使用

 

相关文章:

  • 2021-09-24
  • 2021-08-28
  • 2021-12-28
  • 2021-11-30
  • 2021-10-26
  • 2021-07-28
  • 2021-08-11
  • 2022-12-23
猜你喜欢
  • 2021-09-14
  • 2022-12-23
  • 2022-01-21
  • 2022-12-23
  • 2021-08-06
  • 2021-09-08
相关资源
相似解决方案