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