On 7/15/23 02:16, 小嶋恒 wrote:
I use solr-docker 9.2.1.
It works with the user “solr” (default) but does not work with other users.

I run the below docker-compose.yml code with the command “docker compose up":

#########

version: ‘3’
services:
   solr:
     image: solr:9.2.1
     user: “${UID:?}:${GID:?}”

#########

Please replace ${UID:?} and ${GID:?} with your UID and GID.
Above code failed and displayed:

I'll start by saying that I do not know very much about how to use docker in custom configs. I am blindly finding my way around it but don't use it heavily, so I am not learning it super quickly.

Are you using numeric uid/gid in that config, or names? I don't know that it would even be possible to use names.

Do you have a volume where you map some local path to /var/solr inside the container? If so, you should be able to simply chown the local path for that volume and its contents to the uid/gid that you have configured, and then the permissions inside the container should also be updated so Solr can write to that location.

Why do you need to change the user/group? Unless I'm mistaken one of the primary benefits of using docker is that you can avoid having to heavily customize things in each application so that it can coexist with other applications.

Thanks,
Shawn

Reply via email to