Using Docker

SearchBlox can run inside a Docker container.

Steps to run SearchBlox within Docker container

  1. First we need to create a docker file in any location on a Linux machine. The following commands need to be added to the docker file and saved.
FROM centos:latest
RUN yum update -y && yum install wget -y && yum install curl -y
RUN yum install java-11-openjdk-devel -y
RUN curl -sL https://rpm.nodesource.com/setup_10.x
RUN bash -
RUN yum install -y nodejs
WORKDIR /opt/
RUN adduser searchblox && echo "searchblox:searchblox" | chpasswd
RUN wget https://d2fco3ozzrfhhd.cloudfront.net/v9.2.3/searchblox-9.2.3-0.noarch.rpm && rpm -ivh --nodigest searchblox-9.2.3-0.noarch.rpm
RUN chown -R searchblox:searchblox /opt/searchblox && chmod -R 777 /opt/searchblox/logs && chmod -R 777 /opt/searchblox/elasticsearch
RUN chmod -R 777 /opt/searchblox/bin && chmod -R 777 /opt/searchblox/analytics
USER searchblox
CMD cd /opt/searchblox/elasticsearch && ./bin/elasticsearch -d && sleep 30 && cd /opt/searchblox && bin/start.sh -d && sleep 60 && cd /opt/searchblox/analytics && node index.js
  1. Build a docker image using the following command:
    docker build -t searchblox:latest .

Syntax:
docker build -t <image-name>:<tag-name> .

1600
  1. Run the docker image with the following command:
    docker run -p 8443:8443 -p 8444:8444 -p 9200:9200 searchblox:latest

Syntax:
docker run –p 8443:8443 <image-name>:<tag-name>

1447

Here –p is used to expose the port outside;

Note: To run multiple instances we can change the external port number and run the docker image; Example: docker run –p 2053:8443 <image-name>:<tag-name>
This will start a different instance on port number 2053

  1. Open the SearchBlox Admin console with the following link once SearchBlox starts
    https://localhost:8443/searchblox/admin/main.jsp
1206

What’s Next

You can go through the related sections below