M A
M A

Reputation: 1

Samba server in Solr Docker image, on localhost

Why

Accessing the data inside Solr is cumbersome. Need to ssh into /var/solr directory, and then use command-line operations. So instead, if I can just expose the data directory to a Samba share, and access with a GUI, that is more user-friendly.

Environment details

local

Cloud

At the moment, I am trying to get it to work on my local machine.

Configuration files

solr-develop.Dockerfile

FROM solr:9.6.0 as solr_dev
LABEL name="Solr DEVELOP"

# Switch to root to install packages
USER root

# Install Samba
RUN apt update && \
    apt install -y samba && \
    apt install -y samba-common-bin && \
    apt install net-tools && \
    apt clean && \
    rm -rf /var/lib/apt/lists/*

# Switch back to the Solr user
USER solr

# Copy the Samba configuration file
COPY data/samba/smb.conf /etc/samba/smb.conf

# Expose Samba ports
EXPOSE 139 445

ENTRYPOINT ["docker-entrypoint.sh", "solr", "start", "-c", "-f"]

solr-develop.docker-compose.yaml

name: 'solr_develop'
version: '0.1'
services:
  solr:
    container_name: solr_develop
    build:
      context: .
      dockerfile: solr-develop.Dockerfile
    ports:
      ################### Solr ###################
      - "8983:8983"
      ############################################
      ############### Samba server ###############
      - "139:139"
      # 445 already in use by local system
      - "446:445"
      ############################################
    volumes:
      - ./data/solr:/var/solr
    # command:
    #   - solr-precreate

smb.conf

[global]
   loglevel = 5
   workgroup = WORKGROUP
   server string = Samba Server
   security = user
   map to guest = Bad User
   dns proxy = no

[solr]
   path = /var/solr
   browsable = yes
   writable = yes
   guest ok = yes
   read only = no

Expected result

With the Samba service active, I expected the share to appear on my local Windows Network discovery somehow. I do not know the following:

  1. Where/how should I look to accessing this? File explorer networks
  2. Any additional setting I need to turn on my localhost?
    1. 'resolve *.docker.internal DNS names from both the host and your containers' is enabled
    2. The ports appear to be in use on localhost when the container is up.
  3. Something in the configuration files needs to be modified?
  4. The approach itself is wrong? Maybe should think of just also using an available Samba server image instead of installing

Upvotes: 0

Views: 104

Answers (0)

Related Questions