I’m trying to update NextCloud that is in a Docker container and I’ve had no luck anywhere.
Next cloud is wanting me to update via command line.
When I attempt to use command line to update the OCC (path: /var/lib/docker/volumes/Nextcloud_Application/occ)
It is unable to open the OCC file from outside of the container.
So when I go into the container and attempt to update it that way, I will get:
root@802d9c7ef14f:/var/www/html# ./occ upgrade
Console has to be executed with the user that owns the file config/config.php
Current user id: 0
Owner id of config.php: 33
Try adding 'sudo -u #33' to the beginning of the command (without the single quotes)
If running with 'docker exec' try adding the option '-u 33' to the docker command (without the single quotes)
I have tried ./occ upgrade -u 33 and I get the same message.
Honestly not sure, Its been a long time since I’ve set it up.
I at least know where the occ is located /var/lib/docker/volumes/Nextcloud_Application/occ , so if that’s the default location for a Nextcloud docker install, I likely just followed that, which hopefully was the how nextcloud wanted me to install it and not someone’s guide.
/var/lib/docker/volumes is the a fairly common location for Docker’s own managed volumes within most UNIX-like environments. But the containers/apps (Nextcloud included) have zero awareness of it. It’s purely a construct on your underlying host.
If you brought up the instance using Docker manged volumes, the volumes are either named what you specified on the command-line (using run) or self-documented in your Compose file (in the latter with your stack folder name prepended by default).
Definitely do not run occ from the /var/lib/docker/volumes path. That path is outside the container. The entire point of containers is to isolate things from your host environment. occ must be run within the container not on the underlying host. At best it will simply fail from there.
Looks like it completely reset itself… Oh well, I’ll learn to use snapshots next time.
So the contents of /var/lib/docker/volumes/Nextcloud_Application/_data on your host is empty? I thought you said it contained occ? If so, it should have subfolders in it as well, containing your actual data files (data/), config files (config/), apps (custom_apps), etc.
There are some other ways of bringing up Docker instances, that would result in some of those things (your data, config, apps, etc.) being located in separate volumes, but they’d be located elsewhere in /var/lib/docker/volumes.
It really sounds like you’re not very familiar with Docker (which is completely fine!), but it would behoove you to get a bit familiar with it if you’re going to use a Docker-based deployment. If you don’t want to go down that direction, there are numerous other ways of installing Nextcloud that don’t involve Docker at all. Many of which are highlighted here.