Cube Studio项目中的Docker安装与配置指南
2026-02-04 04:09:19作者:董灵辛Dennis
前言
在Cube Studio项目中,Docker作为容器化技术的核心组件,为整个平台提供了基础运行环境。本文将详细介绍在不同操作系统上安装和配置Docker的完整流程,帮助用户为Cube Studio项目搭建稳定的基础环境。
一、Ubuntu系统安装Docker
1.1 卸载旧版本Docker
在安装新版本前,建议先彻底清理旧版本:
sudo systemctl stop docker
apt-get --purge remove -y *docker*
sudo apt-get autoremove -y
dpkg -l | grep docker
1.2 安装Docker
准备工作
sudo apt-get update -y
sudo apt-get install -y ca-certificates curl gnupg lsb-release vim git wget net-tools
配置国内镜像源(推荐阿里云)
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | apt-key add -
arch=amd64 # 根据架构选择amd64或arm64
sudo add-apt-repository -y "deb [arch=${arch}] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
安装指定版本Docker
sudo apt-get update
apt-cache madison docker-ce # 查看可用版本
# 根据Ubuntu版本选择对应Docker版本
apt install -y docker-ce=5:27.0.3-1~ubuntu.20.04~focal # Ubuntu 20.04
apt install -y docker-ce=5:27.0.3-1~ubuntu.22.04~jammy # Ubuntu 22.04
apt install -y docker-ce=5:27.0.3-1~ubuntu.24.04~noble # Ubuntu 24.04
# 安装docker-compose
apt install -y docker-compose
二、Ubuntu安装Kubernetes客户端
apt-get update && apt-get install -y apt-transport-https
curl https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | apt-key add -
add-apt-repository "deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main"
apt-get update -y
apt-cache madison kubectl # 查看可用版本
apt install -y kubectl=1.24.10-00 # 安装指定版本
# 启用命令补全
apt install -y bash-completion
source <(kubectl completion bash)
三、CentOS系统安装Docker
3.1 安装Docker
# 卸载旧版本
service docker stop
rpm -qa | grep docker | xargs yum remove -y
rm -rf /usr/lib/systemd/system/docker.service
# 安装依赖
yum install -y container-selinux yum-utils
# 配置阿里云镜像源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum update -y
yum list docker-ce --showduplicates # 查看可用版本
yum install -y docker-ce # 安装最新版
# yum install -y docker-ce-26.1.3-1.el8 # 或指定版本
systemctl start docker
3.2 安装Kubernetes客户端
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF
setenforce 0
yum install -y kubectl-1.24.0
source <(kubectl completion bash)
四、RedHat系统安装Docker
dnf update -y
dnf install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
dnf install -y docker-ce docker-ce-cli containerd.io
systemctl start docker
systemctl enable docker
五、Docker配置优化
5.1 基础配置
编辑/etc/docker/daemon.json文件:
{
"registry-mirrors": [
"https://docker.1panel.live",
"https://hub.rat.dev/",
"https://docker.chenby.cn",
"https://docker.m.daocloud.io"
],
"dns": ["114.114.114.114","8.8.8.8"],
"max-concurrent-downloads": 30,
"data-root": "/data/docker",
"insecure-registries":["docker.oa.com:8080"]
}
应用配置:
systemctl stop docker
systemctl daemon-reload
systemctl start docker
5.2 更改Docker存储目录
mkdir -p /data/docker/
cp -R /var/lib/docker/* /data/docker/
rm -rf /var/lib/docker
六、注意事项
-
如果镜像源未生效,可以在拉取镜像时手动添加阿里云镜像前缀:
# 原命令 docker pull rancher/rancher:v2.8.5 # 替换为 docker pull registry.cn-hangzhou.aliyuncs.com/rancher/rancher:v2.8.5 -
建议为Docker分配独立的存储分区,避免系统盘空间不足。
-
生产环境中建议使用特定版本而非最新版,以确保稳定性。
-
对于Kubernetes环境,建议根据集群版本选择匹配的kubectl版本。
通过以上步骤,您已经为Cube Studio项目搭建好了Docker基础环境。这些配置不仅适用于Cube Studio,也可以作为其他容器化项目的参考标准。
登录后查看全文
热门项目推荐
相关项目推荐
atomcodeClaude Code 的开源替代方案。连接任意大模型,编辑代码,运行命令,自动验证 — 全自动执行。用 Rust 构建,极致性能。 | An open-source alternative to Claude Code. Connect any LLM, edit code, run commands, and verify changes — autonomously. Built in Rust for speed. Get StartedRust0191
cann-learning-hubCANN 学习中心仓,支持在线互动运行、边学边练,提供教程、示例与优化方案,一站式助力昇腾开发者快速上手。Jupyter Notebook0118
Step-3.7-FlashStep-3.7-Flash是一个拥有 1980 亿参数的稀疏混合专家(MoE)视觉语言模型,由 1960 亿参数的语言主干网络和 18 亿参数的视觉编码器组合而成,具备原生图像理解能力。Python00
JoyAI-EchoJoyAI-Echo,这是一个独立的、仅用于推理的版本,旨在实现分钟级多镜头音视频生成。它采用了经过蒸馏的DMD生成器、配对的跨模态记忆以及故事级别的一致性。其性能的核心在于,一个跨模态视听记忆库能够在长达五分钟的视频中保持角色外观和语音音色的一致性。同时,一个训练后处理流程将基于记忆的强化学习与分布匹配蒸馏相结合,实现了7.5倍的速度提升,显著增强了视觉质量和对齐效果。00
fun-rec推荐系统入门教程,在线阅读地址:https://datawhalechina.github.io/fun-rec/Python03
so-large-lm大模型基础: 一文了解大模型基础知识01
项目优选
收起
暂无描述
Dockerfile
765
4.97 K
本项目是CANN提供的transformer类大模型算子库,实现网络在NPU上加速计算。
C++
857
1.93 K
本项目是CANN提供的神经网络类计算算子库,实现网络在NPU上加速计算。
C++
680
1.33 K
Ascend Extension for PyTorch
Python
719
879
deepin linux kernel
C
32
16
openEuler内核是openEuler操作系统的核心,既是系统性能与稳定性的基石,也是连接处理器、设备与服务的桥梁。
C
456
438
本项目是CANN提供的数学类基础计算算子库,实现网络在NPU上加速计算。
C++
1.08 K
1.1 K
华为昇腾面向大规模分布式训练的多模态大模型套件,支撑多模态生成、多模态理解。
Python
151
252
CANN 学习中心仓,支持在线互动运行、边学边练,提供教程、示例与优化方案,一站式助力昇腾开发者快速上手。
Jupyter Notebook
303
118
昇腾LLM分布式训练框架
Python
178
220