Docker Community Forums

Share and learn in the Docker community.

Docker volume like ftp


(Margiel) #1

Hi,
I already install owncloud on Fedora release 27.
I started owncloud by docker-compose up and docker runs and works.

Instance of fedora server is only for system not for data. So I want to try modify volume where pictures and documents are store. And my problem is how to create a volume in
docker-compose.yml
which will be connected to my ftp server where the data can be stored.

I try three solutions.
First solution
I’ve mounted ftp
curlftpfs user:pass@192.168.100.5 /mnt/qnap_data/ -o allow_other,uid=0,gid=0,umask=000
and the content was
drwxrwxrwx. 1 root root 1024 Jan 1 1970 qnap_data
After that I changed docker-compose.yml
In section services -> owncloud -> volumes I changed line:
- files:/mnt/data
to: - /mnt/qnap_data/Document/OwnCloudData:/mnt/data

I run docker-compse, docker started correctly, but the site was shutdown and in location
/mnt/qnap_data/Document/OwnCloudData docker create only the folder, no data was saved.

Second solution
It was exactly the same like first but I used
sshfs user@192.168.100.5:/share/Documents/DockerVolumes /mnt/docker_volumes/
And the result was exactly the same, no files was saved in the location.

Third solution
I stop docker and delete my folder volume into location /var/lib/docker/volumes/
and made symlink to ftp from first solution:
ln -s /mnt/qnap_data/Documents/DockerVolumes/ volumes
docker can not run properly.

If anybody has any ideas, I will be grateful for help.


(Victorbarajas89) #2

Your idea is not clear to me, but a temporary solution is that you save the information in a docker volume and from the owncloud console you can upload it to an external ftp server. Maybe that can be useful for you.

Another point that you should keep in mind is the following, when you do a bind mount on a directory that is not empty, docker deletes the contents of that directory not empty to put what exists in bind mount, for example, in the host filesystem you have an X directory with file A and in the filesystem of the container you have a directory Y with file B, when you do a bind mount of directory X over directory Y, file B will be deleted and only file A will remain .