Skip to content

Commit

Permalink
Fix build issues with dockersolr by using "additional_contexts" to pa…
Browse files Browse the repository at this point in the history
…ss solr config path to Dockerfile.
  • Loading branch information
tdonohue committed Feb 2, 2024
1 parent 72407fa commit 48583d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 4 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ services:
container_name: dspacesolr
image: "${DOCKER_OWNER:-dspace}/dspace-solr:${DSPACE_VER:-latest}"
build:
context: .
dockerfile: ./dspace/src/main/docker/dspace-solr/Dockerfile
context: ./dspace/src/main/docker/dspace-solr/
# Provide path to Solr configs necessary to build Docker image
additional_contexts:
solrconfigs: ./dspace/solr/
args:
SOLR_VERSION: "${SOLR_VER:-8.11}"
networks:
Expand Down
12 changes: 7 additions & 5 deletions dspace/src/main/docker/dspace-solr/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ RUN mkdir -p $AUTHORITY_CONFIGSET_PATH && \
mkdir -p $STATISTICS_CONFIGSET_PATH && \
mkdir -p $QAEVENT_CONFIGSET_PATH

COPY dspace/solr/authority/conf/* $AUTHORITY_CONFIGSET_PATH/
COPY dspace/solr/oai/conf/* $OAI_CONFIGSET_PATH/
COPY dspace/solr/search/conf/* $SEARCH_CONFIGSET_PATH/
COPY dspace/solr/statistics/conf/* $STATISTICS_CONFIGSET_PATH/
COPY dspace/solr/qaevent/conf/* $QAEVENT_CONFIGSET_PATH/
# NOTE: "solrconfigs" MUST be passed in by docker-compose via "additional_contexts"
# OR via "docker build --build-context solrconfigs=[path-to-dspace/solr]"
COPY --from=solrconfigs authority/conf/* $AUTHORITY_CONFIGSET_PATH/
COPY --from=solrconfigs oai/conf/* $OAI_CONFIGSET_PATH/
COPY --from=solrconfigs search/conf/* $SEARCH_CONFIGSET_PATH/
COPY --from=solrconfigs statistics/conf/* $STATISTICS_CONFIGSET_PATH/
COPY --from=solrconfigs qaevent/conf/* $QAEVENT_CONFIGSET_PATH/

RUN chown -R solr:solr /opt/solr/server/solr/configsets

Expand Down

0 comments on commit 48583d9

Please sign in to comment.