docker icon indicating copy to clipboard operation
docker copied to clipboard

Error updating custom image with docker-compose adding smb support, docker-compose can't access mariadb folder

Open smb-apache opened this issue 5 years ago • 0 comments

I’m following the steps in: https://help.nextcloud.com/t/howto-ubuntu-docker-nextcloud-talk-collabora/76430

I’m at the part where I added smb support, 5.4. Prior to this everything is fine, but trying to rebuild a custom image I get the following error after updating my dockerfile:

$ docker-compose up --build (or $ docker-compose build --pull) ...

Building nextcloud
Traceback (most recent call last):
File “bin/docker-compose”, line 3, in
File “compose/cli/main.py”, line 67, in main
File “compose/cli/main.py”, line 126, in perform_command
File “compose/cli/main.py”, line 1070, in up
File “compose/cli/main.py”, line 1066, in up
File “compose/project.py”, line 615, in up
File “compose/service.py”, line 346, in ensure_image_exists
File “compose/service.py”, line 1125, in build
File “docker/api/build.py”, line 160, in build
File “docker/utils/build.py”, line 30, in tar
File “docker/utils/build.py”, line 49, in exclude_paths
File “docker/utils/build.py”, line 214, in rec_walk
File “docker/utils/build.py”, line 214, in rec_walk
File “docker/utils/build.py”, line 184, in rec_walk
PermissionError: [Errno 13] Permission denied: ‘/home/(my_username)/nextcloud/mariadb/nextcloud’
[29500] Failed to execute script docker-compose

Currently mariadb folder owner: systemd Core Dumper, Group: root and /mariadb/nextcloud/ is unreadable, and owner: systemd Core Dumper Access: Create and delete files. Group: systemd-coredump Access: None. Every single item in /mariadb directory has a red x icon on it.

Any thoughts on what I need to change? I haven’t changed permissions on mariadb yet, I tried earlier setting it to www-data but it didn’t change anything, so I deleted all the docker-compose and docker images and the data html mariadb folders in /nextcloud and rebuilt.

Here is my docker-compose.yml :

version: '3.7'

networks:
 nextcloud:

services:
  nextcloud:
    image: nextcloud:custom_smb
    build: .
    container_name: nextcloud
    networks:
      - nextcloud
    ports:
      - "127.0.0.1:8080:80"
    volumes:
      - ${NEXTCLOUD_ROOT}/html:/var/www/html
      - ${NEXTCLOUD_ROOT}/data:/srv/nextcloud/data
    extra_hosts:
      - "${NEXTCLOUD_FQDN}:${NEXTCLOUD_IPADDRESS}"
      - "${COLLABORA_FQDN}:${NEXTCLOUD_IPADDRESS}"
    depends_on:
      - mariadb
      - redis
    environment:
      - NEXTCLOUD_TRUSTED_DOMAINS='${NEXTCLOUD_FQDN}'
      - NEXTCLOUD_DATA_DIR=/srv/nextcloud/data
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_HOST=nextcloud-mariadb
      - REDIS_HOST=nextcloud-redis
    restart: unless-stopped

  mariadb:
    image: mariadb
    container_name: nextcloud-mariadb
    restart: unless-stopped
    volumes:
      - ${NEXTCLOUD_ROOT}/mariadb:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
    networks:
      - nextcloud

  redis:
    image: redis
    container_name: nextcloud-redis
    networks:
      - nextcloud
    restart: unless-stopped

  coturn:
    image: instrumentisto/coturn
    container_name: nextcloud-coturn
    restart: unless-stopped
    ports:
      - "3478:3478/tcp"
      - "3478:3478/udp"
    networks:
      - nextcloud
    command:
      - -n
      - --log-file=stdout
      - --min-port=49160
      - --max-port=49200
      - --realm=${NEXTCLOUD_FQDN}
      - --use-auth-secret
      - --static-auth-secret=${COTURN_SECRET}

  collabora:
    image: collabora/code
    container_name: nextcloud-collabora
    restart: unless-stopped
    networks:
      - nextcloud
    ports:
      - "127.0.0.1:9980:9980"
    extra_hosts:
      - "${NEXTCLOUD_FQDN}:${NEXTCLOUD_IPADDRESS}"
      - "${COLLABORA_FQDN}:${NEXTCLOUD_IPADDRESS}"
    environment:
      - 'domain=${NEXTCLOUD_FQDN}'
      - 'dictionaries=en'
    cap_add:
      - MKNOD
    tty: true

smb-apache avatar Nov 17 '20 18:11 smb-apache