参考杨浦老苏的文章,不过有个坑要填,就是compose.yaml里面不能自动创建所有的volume绑定,故,需要先手动绑定volumes,再dockercompose up -d。

docker volume create \
   --driver local \
   --name nextcloud_aio_nextcloud_datadir \
   -o device="/volume4/Adult/nextcloud/data" \
   -o type="none" \
   -o o="bind"

docker volume create \
   --driver local \
   --name nextcloud_aio_redis \
   -o device="/volume3/迅雷/docker/nextcloud/redis" \
   -o type="none" \
   -o o="bind"

docker volume create \
   --driver local \
   --name nextcloud_aio_database_dump \
   -o device="/volume3/迅雷/docker/nextcloud/database_dump" \
   -o type="none" \
   -o o="bind"

docker volume create \
   --driver local \
   --name nextcloud_aio_database \
   -o device="/volume3/迅雷/docker/nextcloud/database" \
   -o type="none" \
   -o o="bind"

docker volume create \
   --driver local \
   --name nextcloud_aio_apache \
   -o device="/volume3/迅雷/docker/nextcloud/apache" \
   -o type="none" \
   -o o="bind"

docker volume create \
   --driver local \
   --name nextcloud_aio_nextcloud \
   -o device="/volume3/迅雷/docker/nextcloud/config" \
   -o type="none" \
   -o o="bind"

我需要所有的占硬盘ops的放在固态中,然后data放入剩余空间更大的机械硬盘。

绑定所有硬盘后就可以dockercompose up -d 了。

version: '3'

volumes:
  nextcloud_aio_mastercontainer:
    name: nextcloud_aio_mastercontainer
    driver: local
    driver_opts:
      type: 'none'
      o: 'bind'
      device: '/volume3/迅雷/docker/nextcloud/aio

services:
  nextcloud-aio-mastercontainer:
    image: nextcloud/all-in-one:latest
    init: true
    restart: always
    container_name: nextcloud-aio-mastercontainer
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config
      - /var/run/docker.sock:/var/run/docker.sock:ro 
    ports:
    #  - 80:80 
      - 8381:8080
    #  - 8443:8443
    environment:
      # - AIO_DISABLE_BACKUP_SECTION=false 
      - APACHE_PORT=11000 
      - APACHE_IP_BINDING=127.0.0.1 
      # - BORG_RETENTION_POLICY=--keep-within=7d --keep-weekly=4 --keep-monthly=6 
      # - COLLABORA_SECCOMP_DISABLED=false 
      - NEXTCLOUD_DATADIR=nextcloud_aio_nextcloud_datadir 
      # - NEXTCLOUD_MOUNT=/mnt/ 
      # - NEXTCLOUD_UPLOAD_LIMIT=10G
      # - NEXTCLOUD_MAX_TIME=3600
      # - NEXTCLOUD_MEMORY_LIMIT=512M
      # - NEXTCLOUD_TRUSTED_CACERTS_DIR=/path/to/my/cacerts
      # - NEXTCLOUD_STARTUP_APPS=deck twofactor_totp tasks calendar contacts notes 
      # - NEXTCLOUD_ADDITIONAL_APKS=imagemagick
      # - NEXTCLOUD_ADDITIONAL_PHP_EXTENSIONS=imagick
      # - NEXTCLOUD_ENABLE_DRI_DEVICE=true
      # - NEXTCLOUD_KEEP_DISABLED_APPS=false
      # - TALK_PORT=3478
      # - WATCHTOWER_DOCKER_SOCKET_PATH=/var/run/docker.sock
    # networks:
      # - nextcloud-aio

#volumes:
#  nextcloud_aio_mastercontainer:
#    name: nextcloud_aio_mastercontainer # This line is not allowed to be changed as otherwise the built-in backup solution will not work
      
# # Optional: If you need ipv6, follow step 1 and 2 of https://github.com/nextcloud/all-in-one/blob/main/docker-ipv6-support.md first and then uncomment the below config in order to activate ipv6 for the internal nextcloud-aio network.
# # Please make sure to uncomment also the networking lines of the mastercontainer above in order to actually create the network with docker-compose
# networks:
#   nextcloud-aio:
#     name: nextcloud-aio # This line is not allowed to be changed as otherwise the created network will not be used by the other containers of AIO
#     driver: bridge
#     enable_ipv6: true
#     ipam:
#       driver: default
#       config:
#         - subnet: fd12:3456:789a:2::/64 # IPv6 subnet to use

填坑二:

安装后Collabora起不了是以为群晖内核不支持Collabora 的 Seccomp 功能,所以需要关闭。

如何禁用 Collabora 的 Seccomp 功能?

Collabora 容器默认启用 Seccomp,这是 Linux 内核的一项安全功能。在未启用此内核功能的系统上,您需要提供--env COLLABORA_SECCOMP_DISABLED=true初始 docker run 命令才能使其工作。