1
1
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS builder
2
2
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
3
3
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
-
9
4
WORKDIR /app
10
5
COPY . /app
11
6
RUN apt update && apt install -y git
@@ -16,22 +11,28 @@ RUN --mount=type=cache,target=/root/.cache/uv \
16
11
RUN --mount=type=cache,target=/root/.cache/uv \
17
12
uv sync --locked --no-editable --no-dev
18
13
14
+ RUN rm -rf ./dist
19
15
RUN uv build
20
16
RUN mv ./dist/sysdig_mcp_server-*.tar.gz /tmp/sysdig_mcp_server.tar.gz
21
17
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
26
20
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
28
29
29
- RUN apt update && apt install -y git
30
30
# 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 .
32
32
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
34
35
35
- USER 1001:1001
36
+ USER appuser
36
37
37
38
ENTRYPOINT ["sysdig-mcp-server" ]
0 commit comments