Using Docker

SearchBlox can run inside a Docker container.

Steps to run SearchBlox within Docker container

FROM centos:latest
RUN yum update -y
RUN yum install java-11-openjdk-devel -y
RUN yum install -y curl
RUN yum install -y wget
RUN adduser searchblox
RUN echo "searchblox:searchblox" | chpasswd
RUN wget
RUN rpm -ivh --nodigest searchblox-9.2.2-0.noarch.rpm
RUN chown -R searchblox:searchblox /opt/searchblox
RUN chmod -R 777 /opt/searchblox/logs
RUN chmod -R 777 /opt/searchblox/elasticsearch
RUN chmod -R 777 /opt/searchblox/bin
USER searchblox
WORKDIR /opt/searchblox/elasticsearch
CMD ./bin/elasticsearch -d && sleep 30 && cd /opt/searchblox && java -jar start.jar
  1. Build docker image using the following command:

docker build –t : .

  1. Run the docker image with the following command:

docker run –p 8083:8080 <image-name>:<tag-name>

Here –p is used to expose the port outside;
Example- In the above command 8080 is the internal port number and 8083 is the externally accessible port number.
Note: To run multiple instances we can change the external port number and run the docker image; Example: docker run –p 8084:8080 <image-name>:<tag-name>
This will start a different instance on port number 8084

  1. Open the SearchBlox Admin console with the following link once SearchBlox starts

What’s Next

You can go through the related sections below

Did this page help you?