NCP docker setup with different data directory

Hi,

I’ve been reading for hours and hours on forums… but i still cant fix it.

I set up /etc/fstab
UUID="6d0ab6c5-cef1-4fc4-9fdb-261cfdc99ce1" /media/ncp ext4 rw,users 0 0

output of lsblk
sdb 8:16 0 596.2G 0 disk └─sdb1 8:17 0 596.2G 0 part /media/ncp
Cleaned docker, nextcloudpi works if i have everything in the normal location, but as soon as i remove the container, delete it and want to create a new container with the following command:

docker run -d -p 4443:4443 -p 443:443 -p 80:80 -v /media/ncp/data:/data --name nextcloudpi ownyourbits/nextcloudpi-armhf xxx.ddns.net

I get this error code:
/run-parts.sh: line 42: /etc/services-enabled.d/000ncp: Permission denied /run-parts.sh: line 47: /etc/services-enabled.d/010lamp: Permission denied /run-parts.sh: line 47: /etc/services-enabled.d/020nextcloud: Permission denied Init done

ls -lha /media/ncp

total 12K
drwxr-xr-x 3 pi root 4.0K Dec 31 10:07 .
drwxr-xr-x 3 root root 4.0K Dec 31 07:11 …
drwxr-xr-x 7 pi pi 4.0K Dec 31 10:10 data

Help me please :slight_smile:

I’d try giving ownership to www-data

sudo chown www-data:www-data /media/ncp/data

As for security reasons, docker has no rights to do that outside the container

Tried it changing to www-data but still the same error :frowning:

Post output of/Check if mounted properly with

df -h

/dev/sdb1 586G 73M 556G 1% /media/ncp

Try removing existing containers and start docker with sudo or is user already added to docker group?

Its the only container that is running, and i did ad pi to docker group…

Check if any remain with

docker ps -a

If any, remove them, before starting new one

no luck… :frowning: what should be the default permission be for these files?

OK Changed /etc/fstab removed rw and users

but now i get this error:

Making /etc/apache2 persistent …
Starting PHP-fpm
Starting Apache
Starting mariaDB
2019-12-31 9:55:45 0 [Note] mysqld (mysqld 10.3.15-MariaDB-1) starting as process 94 …
2019-12-31 9:55:45 0 [Warning] Can’t create test file /data/database/b3054a8ed8c5.lower-test
mysqld: Can’t change dir to ‘/data/database/’ (Errcode: 2 “No such file or directory”)
2019-12-31 9:55:45 0 [ERROR] Aborting

mysqld: Can’t change dir to ‘/data/database/’ (Errcode: 2 “No such file or directory”)

Same issue for me on Docker (debian 10 desktop)

looking to use another internal drive formated BTRFS as ncdata .
It’s working on normal location but as soon as i remove the container, delete it and want to create a new container with the following command:

docker run -d -p 4443:4443 -p 443:443 -p 80:80 -v /media/ncp/data:/data --name nextcloudpi ownyourbits/nextcloudpi-x86 192.168.0.x

error code:
/run-parts.sh: line 47: /etc/services-enabled.d/010lamp: Permission denied /run-parts.sh: line 47: /etc/services-enabled.d/020nextcloud: Permission

tried :
sudo chown www-data:www-data /media/ncp/data
user already added to docker group
No luck