I’m working on running some manual commands on my Nextcloud container, which is the official iXsystems Nextcloud app.
I can get to the CLI for the container from the TrueNAS UI, no problem.
When I run the command:
php -f /var/www/html/occ user:resetpassword admin
I get an error message:
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)
sudo is not installed / found on the container. What’s the proper way to run the command as the user 33 / www-data ?
Got it, thank you - still learning Docker, I am used to Jails / CORE.
Next challenge:
TrueNAS% sudo docker exec -u 33 nextcloud php -f /var/www/html/occ user:resetpassword admin
Error response from daemon: No such container: nextcloud
TrueNAS%
I can clearly see the name of the stack and the container in it are “nextcloud” - do I need to pass another parameter to get connected to the container?
That looks good, but you’ve reached the limit of the help I can offer. I haven’t swapped to Electric Eel myself so I don’t know the naming scheme of the docker containers. A guess would be that they call it something like ix-nextcloud. But that’s just a guess.
… I spoke too soon. I am able to run the command, but I can’t respond to prompts from the occ command (such as putting in the password).
I know the name of the Container now - is there a way to connect to the console of that Container, in an interactive way? The Docker equivalent of iocage console ?