Hello,
I am trying to use containers in order to build a personal cloud. I am using a NFS server and my VM host is a NFS client, i am trying to use this NFS share in my containers.
Concrete use case :
Seafile Deployment using this example : https://download.seafile.com/d/320e8adf90fa43ad8fee/files/?p=/docker/docker-compose.yml
After many times reading docs, it seems that i have to use docker volume, so i build few volumes like this :
docker volume create --driver local --opt type=nfs --opt o=addr=192.168.2.13,rw --opt device=:/volume1/Cloud/Seafile/MYSQL seafile_mysql
root@Seafile:~# docker volume inspect seafile_data
[
{
"CreatedAt": "2019-10-11T21:30:59+02:00",
"Driver": "local",
"Labels": {},
"Mountpoint": "/var/lib/docker/volumes/seafile_data/_data",
"Name": "seafile_data",
"Options": {
"device": ":/volume1/Cloud/Seafile/DATA",
"o": "addr=192.168.2.13,rw",
"type": "nfs"
},
"Scope": "local"
}
]
I use it in the yml file, i run the containers, i was happy, i put few files in the containers that is using my NFS share and i see that the empty space on host VM was reducing ! which is not expected as it should be stored on the remote NFS server.
root@Seafile:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 983M 0 983M 0% /dev
tmpfs 200M 11M 189M 6% /run
/dev/sda1 14G 4.1G 9.0G 32% /
tmpfs 998M 0 998M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 998M 0 998M 0% /sys/fs/cgroup
tmpfs 200M 0 200M 0% /run/user/1000
192.168.2.13:/volume1/Cloud 2.7T 2.2T 549G 81% /mnt/Seafile
//192.168.2.13/Cloud 2.7T 2.2T 549G 81% /mnt/cifs
overlay 14G 4.1G 9.0G 32% /var/lib/docker/overlay2/6b19ddd89720c38c2fe2bd0a0932ae5d8716961282dcec7828459078755b8ac6/merged
overlay 14G 4.1G 9.0G 32% /var/lib/docker/overlay2/6f5fff28267145804887bc6c0944fce8ad53af8988427dba8bf155c2644fbdbf/merged
shm 64M 0 64M 0% /var/lib/docker/containers/96821b1029af2a826e7ab8e42da1ca3fda2c5d2ea64c461b4ced3d71fba1c738/mounts/shm
shm 64M 0 64M 0% /var/lib/docker/containers/776cc8604d6fedae3d9ebbd5ed8d84e48faaa7ea99bdec7d9b48ac4ed613565f/mounts/shm
overlay 14G 4.1G 9.0G 32% /var/lib/docker/overlay2/405c1abe0cd00b63a5f6ed2c7b2f906ddd0cf42dcead1568296e9c82f97b62b6/merged
shm 64M 0 64M 0% /var/lib/docker/containers/b0b778ca69bcff230477d81f4f84af07596149c16e8ae1acf0ad950445d4f7ba/mounts/shm
Can someone tell me what i am doing wrong ?
I have no idea for now, if needed i put my whole yml file to give you all inputs, so sorry for the big post
root@Seafile:~# cat docker-compose.yml
version: '2.0'
services:
db:
image: mariadb:10.1
container_name: seafile-mysql
environment:
- MYSQL_ROOT_PASSWORD=mypassword # Requested, set the root's password of MySQL service.
- MYSQL_LOG_CONSOLE=true
volumes:
- seafile_mysql:/var/lib/mysql # Requested, specifies the path to MySQL data persistent store.
networks:
- seafile-net
memcached:
image: memcached:1.5.6
container_name: seafile-memcached
entrypoint: memcached -m 256
networks:
- seafile-net
seafile:
image: seafileltd/seafile-mc:latest
container_name: seafile
ports:
- "80:80"
volumes:
- seafile_data:/shared # Requested, specifies the path to Seafile data persistent store.
environment:
- DB_HOST=db
- DB_ROOT_PASSWD=mypassword # Requested, the value shuold be root's password of MySQL service.
- TIME_ZONE=Europe/ # Optional, default is UTC. Should be uncomment and set to your local time zone.
- SEAFILE_ADMIN_EMAIL=mail@mail.com # Specifies Seafile admin user, default is 'me@example.com'.
- SEAFILE_ADMIN_PASSWORD=mypassword # Specifies Seafile admin password, default is 'asecret'.
- SEAFILE_SERVER_LETSENCRYPT=false # Whether to use https or not.
- SEAFILE_SERVER_HOSTNAME=seafile.myserver.local # Specifies your host name if https is enabled.
depends_on:
- db
- memcached
networks:
- seafile-net
networks:
seafile-net:
volumes:
seafile_data:
seafile_mysql:
Thanks !