I modified the docker-compose.yml
file as given on https://hub.docker.com/_/solr/ by adding a volumes
configuration and a change in entrypoint
. The modified file is as given:
version: '3'
services:
solr:
image: solr
ports:
- "8983:8983"
volumes:
- ./solr/init.sh:/init.sh
- ./solr/data:/opt/solr/server/solr/mycores
entrypoint:
- init.sh
- docker-entrypoint.sh
- solr-precreate
- mycore
I need to run this 'init.sh' before entrypoint starts, to prepare my files inside container.
But I get following errors:
ERROR: for solr_solr_1 Cannot start service solr: oci runtime error: container_linux.go:247: starting container process caused "exec: \"init.sh\": executable file not found in $PATH"
Earlier I found about official image hooks in neo4j from here. Is there a similar thing I can use here also?
Update 1: From comments below, I realized that dockerfile set WORKDIR /opt/solr
due to which executable file not found in $PATH
. So I tested by providing the absolute path to entrypoint by using /init.sh
. But this also gives error, but a different one:
standard_init_linux.go:178: exec user process caused "exec format error"