Skip to content

Commit ff91bda

Browse files
committed
build: create final image with pip
1 parent c55bf51 commit ff91bda

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ README.md
1414
__pycache__/*
1515
lib/
1616
.python-version
17-
*.yaml

Dockerfile

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,29 @@ ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
88

99
WORKDIR /app
1010
COPY . /app
11+
RUN apt update && apt install -y git
1112
RUN --mount=type=cache,target=/root/.cache/uv \
12-
--mount=type=bind,source=uv.lock,target=uv.lock \
13-
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
14-
uv sync --locked --no-install-project --no-editable --no-dev
13+
--mount=type=bind,source=uv.lock,target=uv.lock \
14+
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
15+
uv sync --locked --no-install-project --no-editable --no-dev
1516
RUN --mount=type=cache,target=/root/.cache/uv \
1617
uv sync --locked --no-editable --no-dev
1718

18-
# Dinal image without uv
19+
RUN uv build
20+
RUN mv ./dist/sysdig_mcp_server-*-py3-none-any.whl /tmp/sysdig_mcp_server-1.0.0-py3-none-any.whl
21+
22+
# Final image without uv
1923
FROM python:3.12-slim
2024
# It is important to use the image that matches the builder, as the path to the
2125
# Python executable must be the same
2226

23-
# Copy the application from the builder
24-
COPY --from=builder --chown=app:app /app /app
25-
2627
WORKDIR /app
2728

28-
# Place executables in the environment at the front of the path
29-
ENV PATH="/app/.venv/bin:$PATH"
29+
RUN apt update && apt install -y git
30+
# Copy the application from the builder
31+
COPY --from=builder --chown=app:app /tmp/sysdig_mcp_server-1.0.0-py3-none-any.whl /app
32+
COPY --from=builder --chown=app:app /app/app_config.yaml /app
33+
34+
RUN pip install /app/sysdig_mcp_server-1.0.0-py3-none-any.whl
3035

31-
ENTRYPOINT ["/bin/sh", "entrypoint.sh"]
36+
ENTRYPOINT ["sysdig-mcp-server"]

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)