一、下载CT模板
二、创建CT
三、添加权限映射
在pve的shell中添加docker权限映射
nano /etc/pve/lxc/xxx.conf
lxc.apparmor.profile: unconfined
lxc.cap.drop:
四、更CT换源
将自带的源文件sources.list备份
cp /etc/apt/sources.list /etc/apt/sources.list_bak
编辑sources.list
nano /etc/apt/sources.list
注释官方源,拷贝清华源
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
五、安装docker
安装curl命令
apt-get install -y curl
获取安装脚本
cur -fsSL get.docker.com -o get-docker.shl
执行安装
sh get-docker.sh --mirror Aliyun
设置自启动
systemctl enable docker
启动docker
systemctl start docker
创建或修改daemon.json文件
nano /etc/docker/daemon.json
{ "registry-mirrors": [ "https://qiojqnqv.mirror.aliyuncs.com", "https://hub-mirror.c.163.com", "https://mirror.baidubce.com" ], "log-driver": "json-file", "log-opts": { "max-size":"100m", "max-file":"3" } }
测试docker
docker run --rm hello-world
六、安装CasaOS
curl -fsSL https://get.casaos.io | bash
安装成功
浏览器访问ip:80即可~