1234mkdir -p /opt/clouddrive2mkdir -p /opt/clouddrive2/cloudmounts # 用于存放云挂载数据mkdir -p /opt/clouddrive2/config # 用于存放配置文件mkdir -p /opt/clouddrive2/media # 可选,用于存放媒体文件 docker-compose.yml 12345678910111213141516171819version: "2.1"services: cloudnas: image: cloudnas/clouddrive2 container_name: clouddrive2 environment: - TZ=Asia/Shanghai - CLOUDDRIVE_HOME=/Config volumes: - /opt/clouddrive2/cloudmounts:/CloudNAS:shared # 将云挂载目录挂载到容器 - /opt/clouddrive2/config:/Config # 将配置文件目录挂载到容器 - /opt/clouddrive2/media:/media:shared # 可选:将媒体目录挂载到容器 devices: - /dev/fuse:/dev/fuse # FUSE 支持,允许挂载云存储 restart: unless-stopped pid: "host" privileged: true network_mode: "host" # 使用宿主机网络模式