Cannot find files of owncloud-docker

I installed ownCloud via docker (only for LAN access) on an elementaryOS computer using the following tutorial: Docker Series Pt.1: How to Set up an ownCloud in 3 Minutes

In part 3 of the same guide (Docker Series Pt.3: Automatically Backup and Restore a Dockerized ownCloud) there are instructions to backup. Specifically:

sudo rsync -r /var/lib/docker/volumes/owncloud_files ../owncloud_backup/
sudo rsync -r /var/lib/docker/volumes/owncloud_mysql ../owncloud_backup/

However, even after stopping Docker and switching to superuser via sudo -i, the /var/lib/docker/volumes is completely empty.

What am I doing wrong here?

my compose file:


volumes:
  files:
    driver: local
  mysql:
    driver: local
  backup:
    driver: local
  redis:
    driver: local

services:
  owncloud:
    image: owncloud/server:${OWNCLOUD_VERSION}
    restart: always
    ports:
      - ${HTTP_PORT}:8080
    depends_on:
      - db
      - redis
    environment:
      - OWNCLOUD_DOMAIN=${OWNCLOUD_DOMAIN}
      - OWNCLOUD_DB_TYPE=mysql
      - OWNCLOUD_DB_NAME=owncloud
      - OWNCLOUD_DB_USERNAME=owncloud
      - OWNCLOUD_DB_PASSWORD=owncloud
      - OWNCLOUD_DB_HOST=db
      - OWNCLOUD_ADMIN_USERNAME=${ADMIN_USERNAME}
      - OWNCLOUD_ADMIN_PASSWORD=${ADMIN_PASSWORD}
      - OWNCLOUD_MYSQL_UTF8MB4=true
      - OWNCLOUD_REDIS_ENABLED=true
      - OWNCLOUD_REDIS_HOST=redis
    healthcheck:
      test: ["CMD", "/usr/bin/healthcheck"]
      interval: 30s
      timeout: 10s
      retries: 5
    volumes:
      - files:/mnt/data

  db:
    image: webhippie/mariadb:latest
    restart: always
    environment:
      - MARIADB_ROOT_PASSWORD=owncloud
      - MARIADB_USERNAME=owncloud
      - MARIADB_PASSWORD=owncloud
      - MARIADB_DATABASE=owncloud
      - MARIADB_MAX_ALLOWED_PACKET=128M
      - MARIADB_INNODB_LOG_FILE_SIZE=64M
    healthcheck:
      test: ["CMD", "/usr/bin/healthcheck"]
      interval: 30s
      timeout: 10s
      retries: 5
    volumes:
      - mysql:/var/lib/mysql
      - backup:/var/lib/backup

  redis:
    image: webhippie/redis:latest
    restart: always
    environment:
      - REDIS_DATABASES=1
    healthcheck:
      test: ["CMD", "/usr/bin/healthcheck"]
      interval: 30s
      timeout: 10s
      retries: 5
    volumes:
      - redis:/var/lib/redis

Hi there,
Not sure where your Elementary OS puts your docker volumes, but here is how you should be able to find out:

  1. run docker volume ls this should show you something like this:
root@erik-docker0:~/test# docker volume ls
DRIVER              VOLUME NAME
local               test_backup
local               test_files
local               test_mysql
local               test_redis
  1. run docker volume inspect VOLUME NAME, for example:
root@erik-docker0:~/test# docker volume inspect test_files
[
    {
        "CreatedAt": "2019-07-08T09:27:43+02:00",
        "Driver": "local",
        "Labels": {
            "com.docker.compose.project": "test",
            "com.docker.compose.version": "1.24.0",
            "com.docker.compose.volume": "files"
        },
        "Mountpoint": "/var/lib/docker/volumes/test_files/_data",
        "Name": "test_files",
        "Options": null,
        "Scope": "local"
    }
]

As you can see this should show you the mountpoint in the host system (docker0).
Let me know should you have any further questions.
Cheers,
Erik

1 Like

It seems that for some reason snap is involved. Path is
/var/snap/docker/common/var-lib-docker/volumes/

Thanks for the help!

1 Like