'Docker Compose Solr authentication: No authentication configured
I am having issues adding auth to Solr in a Docker container. I have tried copying the security.json file to the Solr container's $SOLR_HOME folder. But it's returning a response at http://localhost:8983/solr/admin/authentication:
{
"responseHeader":{
"status":0,
"QTime":0},
"errorMessages":["No authentication configured"]}
security.json:
{
"authentication":{
"blockUnknown": true,
"class":"solr.BasicAuthPlugin",
"credentials":{"solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="},
"realm":"My Solr users",
"forwardCredentials": false
},
"authorization":{
"class":"solr.RuleBasedAuthorizationPlugin",
"permissions":[{"name":"security-edit",
"role":"admin"}],
"user-role":{"solr":"admin"}
}}
I'm copying the file in the docker-compose.yml in the volume:
version: "3"
services:
index:
image: solr:8.11.1
ports:
- "8983:8983"
volumes:
- data:/var/solr
- ./security/security.json:/opt/solr-8.11.1/server/solr/security.json
command:
- solr-precreate
- archive_poc_core
volumes:
data:
When I go into the container and check if the file is there with the settings, I can find it. So I don't think that's the problem. I think that the file is copied after solr is started but not sure how to get the security file prior on the container or what the correct way of doing it should be.
Any help, guidance or advice would be appreciated.
Guides I looked at:
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
