Skip to content

Commit 0b77a90

Browse files
authored
build: Change base image to sysdig-ubi (#20)
1 parent 2951018 commit 0b77a90

File tree

3 files changed

+381
-277
lines changed

3 files changed

+381
-277
lines changed

Dockerfile

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS builder
22
ENV 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-
94
WORKDIR /app
105
COPY . /app
116
RUN apt update && apt install -y git
@@ -16,22 +11,28 @@ RUN --mount=type=cache,target=/root/.cache/uv \
1611
RUN --mount=type=cache,target=/root/.cache/uv \
1712
uv sync --locked --no-editable --no-dev
1813

14+
RUN rm -rf ./dist
1915
RUN uv build
2016
RUN 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

3738
ENTRYPOINT ["sysdig-mcp-server"]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "sysdig-mcp-server"
3-
version = "0.2.0"
3+
version = "0.3.0"
44
description = "Sysdig MCP Server"
55
readme = "README.md"
66
requires-python = ">=3.12"

0 commit comments

Comments
 (0)