We’ve all been there. Everybody is guilty of it. Me, my father, sisters, granpa… even my pet hamster did it! INSTALLING A NEXTCLOUD INSTANCE IN DOCKER.
Obviously, this is not a bad choice, but it might be extra hard to do basic administration, given the extra layer of virtualization. Now, let’s look at how to connect to the nextcloud container in the right way, so we can do basic checks and integrity repairs.
Picking an action: Upgrade
Asuming the docker node on which the nextcloud instance is running is swarm-x64-1. We’ll pick a basic task of finishing an upgrade that the system thought would be a good idea. Or even, doing a manual upgrade of the software in the container. Be aware though. The changes will be rolled back once you refresh the service with the default image, taken from the repository.
FYI: Using the default image: image: nextcloud:22
Anyways, the key to success is connecting as the correct user to run the commands, as it has all the env already set up. Now, let’s get dirty with the commands.
[root@swarm-x64-1 ~]# docker exec --user www-data <container> php occ upgrade
Update app groupfolders from App Store
Checked for update of app "groupfolders" in App Store
Starting code integrity check…
Finished code integrity check
Maintenance mode is kept active
Resetting log level
[root@swarm-x64-1 ~]# docker exec –user www-data <container> php occ maintenance:mode –off
Don’t forget to go with the versions below. Otherwise, you WILL be in pain.
image: mariadb:10.5 image: nextcloud:22