-
Notifications
You must be signed in to change notification settings - Fork 387
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (21 loc) · 843 Bytes
/
Dockerfile
File metadata and controls
29 lines (21 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
ARG SPLUNK_VERSION=latest
FROM splunk/splunk:${SPLUNK_VERSION}
USER root
# We need to copy the entire folder, because Dockerfile doesn't offer optional copy
# I.e. if splunk-mcp-server.tgz doesn't exist, the entire build fails
RUN mkdir /tmp/sdk
COPY . /tmp/sdk
RUN /bin/bash -c '[ -f /tmp/sdk/splunk-mcp-server.tgz ] && cp /tmp/sdk/splunk-mcp-server.tgz /splunk-mcp-server.tgz'
RUN rm -rf /tmp/sdk
RUN mkdir /tmp/sdk
COPY ./pyproject.toml /tmp/sdk/pyproject.toml
COPY ./splunklib /tmp/sdk/splunklib
RUN mkdir /splunklib-deps
RUN chown splunk:splunk /splunklib-deps
RUN chown -R splunk:splunk /tmp/sdk
RUN chown splunk:splunk /tmp/sdk
USER splunk
WORKDIR /tmp/sdk
RUN /bin/bash -c "LD_LIBRARY_PATH=/opt/splunk/lib /opt/splunk/bin/python3.13 -m pip install '.[openai]' --target=/splunklib-deps"
USER ${ANSIBLE_USER}
WORKDIR /opt/splunk