💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
Docker 提供容器运行时环境,具体的依赖参考下方的链接: - [bridge-utils](http://www.rpmfind.net/linux/rpm2html/search.php) - [container-selinux](https://pkgs.org/download/container-selinux) - [docker](https://download.docker.com/linux/centos) - [containerd-io](https://download.docker.com/linux/centos/) - [docker-ce-cli](https://download.docker.com/linux/centos/) 由于容器运行对版本要求比较严格,所以本小节主要用离线的方式来进行安装,离线安装的好处在于各组件版本可控 --- ### 互联网 ``` [CentOS] yum -y install bridge-utils - 跳到配置部分 yum -y install docker [Ubuntu] curl https://releases.rancher.com/install-docker/20.10.sh | sh ``` --- ### 局域网 ``` rpm -ivh bridge-utils-1.7.1-2.el8.x86_64.rpm ``` --- ### CentOS ``` yum remove -y docker docker-client docker-cli - 创建新的默认网段 iptables -t nat -F POSTROUTING brctl addbr docker0 ip addr add 192.168.200.1/24 dev docker0 ip link set dev docker0 up - 上传从上面连接下载的安装包并安装 rpm -ivh docker-ce-cli-18.09.8-3.el7.x86_64.rpm yum -y install policycoreutils-python yum -y install selinux-policy selinux-policy-base selinux-policy-targeted yum -y install libseccomp rpm -ivh container-selinux-2.107-3.el7.noarch.rpm rpm -ivh containerd.io-1.2.2-3.el7.x86_64.rpm rpm -ivh docker-ce-18.09.8-3.el7.x86_64.rpm docker --version - 重启服务 systemctl start docker systemctl status docker systemctl stop docker - 修改默认的网段和网桥 vi /etc/docker/daemon.json { "registry-mirrors": ["http://10.145.11.76:7030"], "insecure-registries": ["10.145.11.76:7030"], "bip":"192.168.200.1/24", "data-root":"/data/docker" } systemctl daemon-reload systemctl enable docker systemctl restart docker ``` --- ### 常用命令 ``` docker ps -aq // 列出所有ID docker stop $(docker ps -aq) // 停止所有容器 docker rmi $(docker ps -aq) // 删除镜像 docker system prune -af // 回收所有资源 - 卸载 yum list installed | grep docker yum -y remove <above> rm -rf /var/lib/docker ifconfig docker0 down yum -y install bridge-utils brctl delbr docker0 ```