docker 19安装
以下是docker 19安装步骤
systemctl stop docker
rm -rf /var/lib/docker/devicemapper
#cd /etc/yum.repos.d/ && mv CentOS-Base.repo CentOS-Base.repo.bak && mv epel.repo epel.repo.bak && yum -y update
cd /data0 && mkdir docker
cd docker
wget http://10.85.187.171:8080/docker/rpm/containerd.io-1.2.10-3.2.el7.x86_64.rpm
wget http://10.85.187.171:8080/docker/rpm/docker-ce-cli-19.03.3-3.el7.x86_64.rpm
wget http://10.85.187.171:8080/docker/rpm/docker-ce-19.03.3-3.el7.x86_64.rpm
yum remove -y docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine docker-selinux
yum install -y containerd.io-1.2.10-3.2.el7.x86_64.rpm
yum install -y docker-ce-cli-19.03.3-3.el7.x86_64.rpm
yum install -y docker-ce-19.03.3-3.el7.x86_64.rpm
echo '{"insecure-registries" : ["registry.intra.weibo.com", "registry.api.weibo.com"],"graph": "/data0/docker"}' > '/etc/docker/daemon.json'
systemctl restart docker```
- docker的使用
(1)查看本地docker容器
docker ps
(2)启动一个容器
docker run -itd --name=xxx --net=host -e MODE=dev url:latest
(2)进入一个容器
docker-enter [容器名]
docker exec -it [容器名] /bin/bash
(3)退出容器
ctrl + D
(4)删除一个容器
docker rm [容器ID]
- docker 容器的搭建