centos7安装docker

1、删除旧版本
sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine
2、安装依赖包
sudo yum install -y yum-utils \ device-mapper-persistent-data \ lvm2

3、配置yum仓库
sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo
4、安装:
selinux=disabled
systemctl disable firewalld


sudo yum install docker-ce docker-ce-cli containerd.io


5、测试:
systemctl start docker
systemctl enable docker
docker run hello-world
docker info

制作容器:
docker run -it nginx
查看容器:

docker ps

docker inspect +容器ID

posted @ 2020-03-02 11:11  黑剑石清  阅读(179)  评论(0编辑  收藏  举报