How can I set up default language in Dockerfile?

Now I’m using Nextcloud(ver. 16.0.1) on Docker.
I know I can set up default language via config.php and I’ ve already added default_language => "en" to it.
But, I wanna add the configration automatically in docker build process.
How can I achieve this ?
Thanks.

how did you do that?

nextcloud is installed during the run of the entrypoint.sh skript. So if you really want to do this during docker build you have to clone nextcloud/docker from github and insert before line 139 in the following skript a task to insert default_language => "en" into config.php. I don’t know if there is a occ command for this.

nevertheless that has a lot of disadvantages. you have to repeat this procedure with each update of nextcloud.

why you don’t simply map a directory from your host to /var/www/html/config into the container and edit the file on your host.

I’m sorry to be late for replying your kind help.

how did you do that?
I ran following command on my nextcloud container.

# su -p www-data -s /bin/sh -c "/var/www/html/occ config:system:set default_language --value="ja""

if you really want to do this during docker build you have to clone nextcloud/docker from github and insert before line 139 in the following skript a task to insert default_language => "en" into config.php.

OK. I’ll try this later. Thanks.

you may also look at https://hub.docker.com/_/nextcloud chapter " Adding Features".

1 Like