diff --git a/Dockerfile b/Dockerfile index 3fd098fd..46c6ee78 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,16 +3,15 @@ FROM splunk/splunk:${SPLUNK_VERSION} USER root -# Copy splunk-mcp-server.tgz, we need to copy entire sdk since -# splunk-mcp-server.tgz might not exist and we don't want to fail in such case. +# 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 'if [ -f /tmp/sdk/splunk-mcp-server.tgz ]; then cp /tmp/sdk/splunk-mcp-server.tgz /splunk-mcp-server.tgz; fi' +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 ./uv.lock /tmp/sdk/uv.lock COPY ./splunklib /tmp/sdk/splunklib RUN mkdir /splunklib-deps @@ -24,8 +23,7 @@ USER splunk WORKDIR /tmp/sdk -RUN /opt/splunk/bin/python3.13 -m venv .venv -RUN /bin/bash -c "source .venv/bin/activate && LD_LIBRARY_PATH=/opt/splunk/lib python -m pip install '.[openai]' --target=/splunklib-deps" +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 diff --git a/Makefile b/Makefile index 9d564000..e62aa91d 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,7 @@ SPLUNK_HOME := /opt/splunk docker-up: # For podman (at least on macOS) you might need to add DOCKER_BUILDKIT=0 # --build forces Docker to build a new image instead of using an existing one - @docker-compose up -d --build + docker compose up -d --build .PHONY: docker-ensure-up docker-ensure-up: @@ -97,14 +97,14 @@ docker-start: docker-up docker-ensure-up .PHONY: docker-down docker-down: - docker-compose stop + docker compose stop .PHONY: docker-restart docker-restart: docker-down docker-start .PHONY: docker-remove docker-remove: - docker-compose rm -f -s + docker compose rm -f -s .PHONY: docker-refresh docker-refresh: docker-remove docker-start diff --git a/docker-compose.yml b/compose.yml similarity index 100% rename from docker-compose.yml rename to compose.yml