一、安装fuse3
yum install fuse3
mkdir -p /etc/systemd/system/docker.service.d/
cat <<EOF > /etc/systemd/system/docker.service.d/clear_mount_propagation_flags.conf
[Service]
MountFlags=shared
EOF
二、查找挂载点目录
df -h
选择一个目录挂载
mount --make-shared /home
三、安装clouddrive2
1、方法 1:创建docker-compose.yaml 并编辑它
touch docker-compose.yaml
编辑docker-compose.yaml
vi docker-compose.yaml
version: "2.1"
services:
cloudnas:
image: cloudnas/clouddrive2-unstable
container_name: clouddrive2
ports:
- "19798:19798"
environment:
- TZ=Asia/Shanghai
- CLOUDDRIVE_HOME=/Config
volumes:
- /home/clouddrive/shared:/CloudNAS:shared
- /home/clouddrive/Config:/Config
- /home/clouddrive/media/shared:/media:shared #optional media path of host
devices:
- /dev/fuse:/dev/fuse
restart: unless-stopped
pid: "host"
privileged: true #or you can try capp_add -SYS_ADMIN
#cap_add: #SYS_ADMIN cap may fail on some OSes, use privileged: true instead
# - SYS_ADMIN
network_mode: "host" #if network_mode doesn't work, use port mapping
启动clouddrive2
docker-compose pull
docker-compose up -d
2、方法 2:直接拉取
docker pull cloudnas/clouddrive2-unstable
启动clouddrive2
docker run -d \
--name clouddrive2 \
--restart unless-stopped \
--env CLOUDDRIVE_HOME=/Config \
-v /home/clouddrive/shared:/CloudNAS:shared \
-v /home/clouddrive/Config:/Config \
-v /home/clouddrive/media/shared:/media:shared \
-p:19798:19798 \
--privileged \
--device /dev/fuse:/dev/fuse \
cloudnas/clouddrive2-unstable
最后访问IP
http://<ip>:19798
转自:clouddrive2 docker安装 - 简书 (jianshu.com)
- THE END -
最后修改:2024年2月1日
非特殊说明,本博所有文章均为博主原创。
如若转载,请注明出处:https://lg5.top/1175.html
共有 1 条评论