Nextcloud in Docker - Reset Admin Password

Hello there!

I hope I am in the right section.

Using docker on a Synology NAS I have installed a Nextcloud which is working fine so far. But now I face the problem that I have lost the Administratorpassword for the nextcloud.
Searching the Nextcloud-forums I found out that generally the following bash-command is able to reset the Admin password:

sudo -u www-data php /var/www/nextcloud/occ user:resetpassword admin

Unlucky me, the sudo command cannot be used in the Docker bash. Because I am a total noob in Linux and bash I now need help to change the command to get it to run it in the Docker-terminal.

Hope somebody can help me!
Regards
B.
(Sorry for my rusty English!)

I up this post because I have the same problem.
sudo is not installed in container and I can’t install with apt install.
sudo -u is same su command, but su are not authorized in container.
And when I run : ls /var/www/nextcloud/, folder does not exist.
But occ are in /var/www/html/, but when I run ./var/www/nextcloud/occ user:resetpassword admin
I get this :
bash: ./var/www/nextcloud/occ: No such file or directory

This

Since we have no sudo in containers, you will need to execute the command as docker exec command and set the user in this command like this:

docker exec -ti -u www-data <next cloud container name> php /usr/src/nextcloud/occ user:resetpassword admin

Note: this is untested. I just pulled the image, started a container with docker run -ti --rm --entrypoint bash nextcloud and used find / -name occ inside the container to find the path and checked /etc/passwd for the existence of the user www-data and it exists. I assume this user is also used inside the container.

I am not able to answer any follow up questions about this.