Commit 24e27779 authored by Luca Cinquini's avatar Luca Cinquini
Browse files

Running Solr as solr user.

parent 4e905ad4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -16,7 +16,8 @@ function build_and_push() {
  echo "BUILDING MODULE=$img PUSH=$pushit\n"

  # build the module
  docker build --no-cache --build-arg ESGF_REPO=$ESGF_REPO -t esgfhub/$img .
  #docker build --no-cache --build-arg ESGF_REPO=$ESGF_REPO -t esgfhub/$img .
  docker build --no-cache -t esgfhub/$img .

  # optionally push the module to Docker Hub
  if [[ $pushit == *"push"* ]]; then
+8 −0
Original line number Diff line number Diff line
@@ -26,8 +26,16 @@ COPY scripts/add_shard.sh /usr/local/bin/add_shard.sh
RUN /usr/local/bin/add_shard.sh master 8984
RUN /usr/local/bin/add_shard.sh slave 8983

# create non-privilged user to run Solr server
RUN groupadd solr
RUN useradd -s /sbin/nologin -g solr -d /usr/local/solr solr
RUN chown -R solr:solr /usr/local/solr-${SOLR_VERSION}
RUN chown -R solr:solr ${SOLR_HOME}
RUN chown -R solr:solr ${SOLR_DATA_DIR}

EXPOSE 8983
EXPOSE 8984

COPY scripts/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
USER solr
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]