11FROM  ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS builder
22ENV  UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
33
4- #  Disable Python downloads, because we want to use the system interpreter
5- #  across both images. If using a managed Python version, it needs to be
6- #  copied from the build image into the final image; see `standalone.Dockerfile`
7- #  for an example.
8- 
94WORKDIR  /app
105COPY  . /app
116RUN  apt update && apt install -y git
@@ -16,22 +11,28 @@ RUN --mount=type=cache,target=/root/.cache/uv \
1611RUN  --mount=type=cache,target=/root/.cache/uv \
1712    uv sync --locked --no-editable --no-dev
1813
14+ RUN  rm -rf ./dist
1915RUN  uv build
2016RUN  mv ./dist/sysdig_mcp_server-*.tar.gz /tmp/sysdig_mcp_server.tar.gz
2117
22- #  Final image without uv
23- FROM  python:3.12-slim
24- #  It is important to use the image that matches the builder, as the path to the
25- #  Python executable must be the same
18+ #  Final image with UBI
19+ FROM  quay.io/sysdig/sysdig-mini-ubi9:1
2620
27- WORKDIR  /app
21+ #  Install Python 3.12 and git
22+ RUN  microdnf update -y && \
23+     microdnf install -y python3.12 python3.12-pip git && \
24+     microdnf clean all
25+ 
26+ #  Create a non-root user
27+ RUN  useradd -u 1001 -m appuser
28+ WORKDIR  /home/appuser
2829
29- RUN  apt update && apt install -y git
3030#  Copy the application from the builder
31- COPY  --from=builder --chown=app:app  /tmp/sysdig_mcp_server.tar.gz /app 
31+ COPY  --from=builder --chown=appuser:appuser  /tmp/sysdig_mcp_server.tar.gz . 
3232
33- RUN  pip install /app/sysdig_mcp_server.tar.gz
33+ #  Install the application
34+ RUN  python3.12 -m pip install --no-cache-dir sysdig_mcp_server.tar.gz
3435
35- USER  1001:1001 
36+ USER  appuser 
3637
3738ENTRYPOINT  ["sysdig-mcp-server" ]
0 commit comments