配置后重启
systemctl daemon-reload
systemctl restart docker
参考:https://docs.docker.com/install/linux/docker-ce/centos/
yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce
systemctl start docker
https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
curl -fsSL get.docker.com -o get-docker.sh
sh get-docker.sh
curl https://releases.rancher.com/install-docker/17.03.sh | sh
https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
vim /usr/lib/systemd/system/docker.service
add:
--registry-mirrors=https://registry.docker-cn.com
systemctl daemon-reload && systemctl restart docker
systemctl daemon-reload && systemctl restart docker
systemctl start docker && systemctl enable docker
cd /etc/yum.repo
wget https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce
简单方法:
wget -P /etc/yum.repos.d https://download.docker.com/linux/centos/docker-ce.repo
ls -l /etc/yum.repos.d
yum install docker-ce
Open https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-18.03.1.ce-1.el7.centos.x86_64.rpm
yum localinstall docker-ce-18.03.1.ce-1.el7.centos.x86_64.rpm
RUN
docker run -d abc
EXEC
docker exec -it xxx /bin/bash