玩客云s805 docker

s805

Posted by Pg on May 29, 2025

一键关闭虚拟内存

1
2
3
4
5
6
sudo swapoff -a && \
sudo sed -i '/swap/s/^/#/' /etc/fstab && \
echo "vm.swappiness=0" | sudo tee -a /etc/sysctl.conf && \
sudo sysctl -p && \
sudo rm -f /swapfile && \
free -h

ip4转发+smb

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
cat << 'EOF' >> /etc/sysctl.conf
net.ipv4.ip_forward=1
EOF
sudo sysctl -p
sudo apt install git
sudo apt update && sudo apt upgrade -y
sudo apt update && sudo apt install samba -y
# 2. 备份原配置文件
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
# 3. 生成新配置文件
cat << 'EOF' >> /etc/samba/smb.conf
[global]
   workgroup = WORKGROUP
   server role = standalone server
   security = user
   map to guest = Bad User
   dns proxy = no

[dav]
   path = /mnt
   browseable = yes
   writable = yes
   guest ok = yes
   guest only = yes
   create mask = 0777
   directory mask = 0777
   force user = nobody
EOF
# 4. 设置目录权限
sudo chmod -R 777 /mnt
sudo chown -R nobody:nogroup /mnt
# 5. 重启服务
sudo systemctl restart smbd
sudo systemctl enable smbd
echo "SMB共享已启用:smb://$(hostname -I | awk '{print $1}')/dav/"
lsblk
mkdir /mnt/hp
mount /dev/sda1 /mnt/hp
cat << EOF >> /etc/fstab
UUID=e0280430-4e37-471a-b784-ad948d7e48f4 /mnt/hp ext4 nosuid,nodev,nofail 0 0
EOF

docker-compose installation

1
2
3
4
5
6
7
8
9
10
apt install -y docker.io
apt install docker-compose -y
#### 1.2 启动 Docker 服务
usermod -aG docker $USER
systemctl start docker
systemctl enable docker

docker exec -it alist ./alist admin random
#### 1.3 验证安装
docker --version

alist

1
2
3
4
5
6
7
8
9
10
11
12
13
14
mkdir ~/alist
cd alist
docker run -d \
  --restart=always \
  -v /etc/alist:/opt/alist/data \
  -v /mnt/hp:/mnt/hp \
  -p 5244:5244 \
  -e PUID=0 \
  -e PGID=0 \
  -e UMASK=022 \
  --name="alist" \
  --memory=256m \
  xhofe/alist \
  sh -c "sleep 40 && exec /entrypoint.sh"

aria2-pro

1
2
3
4
5
6
7
8
9
10
11
12
13
14
mkdir ~/aria2-pro
cd
cd aria2-pro
docker run -d \
    --name aria2-pro \
    --restart unless-stopped \
    --log-opt max-size=1m \
    -e RPC_SECRET=4eede87d38e1b599f317 \
    -p 6800:6800 \
    -p 6888:6888 \
    -p 6888:6888/udp \
    -v /aria2-pro:/config \
    -v /mnt/hp:/downloads \
    p3terx/aria2-pro
aria2-webui
1
2
3
4
5
6
7
8
9
mkdir ~/aria2-webui
cd
cd aria2-webui
docker run -d \
    --name ariang \
    --log-opt max-size=1m \
    --restart unless-stopped \
    -p 6880:6880 \
    p3terx/ariang