The first service my_solr has some commands in the entrypoint segment to prepare the container for a specific extension, it is called a “core”. The extension is a set of xml-files. Currently I insert them into the container by the following sequence:
1.) Invoke docker-compose with my docker-compose-file with the command “up”.
2.) Invoke docker cp C:\Users\admin\Source\Repos\MySolrExtensions mySolr:/opt/solr/server/solr/mycores/
3.) Restart both containers.
I do not want to make the steps as described above. I want one docker-compose-file, that copies everything to the right place a that’s it.
Can I create a second Dockerfile that invokes the following
Hi Konrad,
thank you very much for yours help.
My “extensions” directory has a subfolder “myCore”, that contains some configuration files and subfolders.
The subfolder “myCore” including all containing subfolders and files should be copied to
/opt/solr/server/solr/mycores/myCore
What happens is, that the “myCore” folder is created, but the files are not copied into the “myCore” folder, instead they are copied to the same “level” as the folder “myCore”.
COPY /extensions/myCore/* /opt/solr/server/solr/mycores/myCore/
=> The directory “myCore” exists, but the extensions where not copied.
I suspect that the RUN command needs something more, to execute the “precreate-core myCore”.
To check this out I tried to execute solr already in the run, on the image build process. My idea was, that on the image the command (precreate-core myCore exec solr) is executed once and the core is created and ready to be filled with the extensions, that will be copied by starting the container.
FROM solr:7.7.2
RUN ["bash", "-c", "precreate-core myCore", "exec solr -f"]
COPY /extensions/ /opt/solr/server/solr/mycores/
ENTRYPOINT ["bash", "-c", "exec solr -f"]
Well, this does not work, too.
Do you have any idea?
Thanks a lot for your willingness to support.
Christian