Nextcloud version (eg, 20.0.5): 24.02
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): apache2
PHP version (eg, 7.4): php 8.0.20
The issue you are facing:
I run a nextcloud with docker-compose. and I could run this command in nextcloud container
www-data@ad41920cfec1:~/html$ OC_PASS="somewhereOVERTHERAINBOW" ./occ user:add --password-from-env --display-name "CH" --group regular changch
The user "changch" was created successfully
Display name set to "CH"
User "changch" added to group "regular"
www-data@ad41920cfec1:~/html$
but outside the container , can’t pass the OC_PASS variable to occ
chchang@dc039:~/docker/nextcloud-libreoffice-online/nextcloud/nextcloud$ docker exec -u 33 -it nextcloud-app-1 OC_PASS="somewhereOVERTHERAINBOW" ./occ user:add --password-from-env --display-name "CH" --group regular changch
OCI runtime exec failed: exec failed: unable to start container process: exec: "OC_PASS=somewhereOVERTHERAINBOW": executable file not found in $PATH: unknown
so I’m wondering if there is any way to add a nextcloud user in docker version with occ command ?? or maybe any other commands to do so ?