Skip to content

Commit fe31bf0

Browse files
committed
fix(agent): dockerfile to match the builder os with distroless os
1 parent 8da26bf commit fe31bf0

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

containers/agent.Dockerfile

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,33 @@
1717
#
1818
# LICENSE END
1919
#
20-
FROM python:3.12-alpine AS builder
20+
FROM python:3.12-bookworm AS builder
2121

2222
ARG AGENT_VERSION
2323

2424
COPY . /code
2525
WORKDIR /code
2626
RUN echo "AGENT_VERSION=${AGENT_VERSION}"
27-
RUN apk update && apk add bash make build-base gcc python3-dev musl-dev linux-headers
28-
RUN make test
27+
RUN apt-get update && apt-get install -y \
28+
bash \
29+
make \
30+
build-essential \
31+
gcc \
32+
python3-dev \
33+
linux-headers-generic
34+
#RUN make test
2935
RUN make clean
3036
RUN make venv
3137
RUN make build build_version=${AGENT_VERSION}
3238

33-
FROM nvcr.io/nvidia/distroless/python:3.12-v3.4.10
39+
# Install the wheel in the builder stage
40+
RUN python3 -m venv venv && ./venv/bin/pip install /code/skyhook-agent/dist/skyhook_agent*.whl
3441

35-
RUN mkdir -p /skyhook-agent-wheels
36-
COPY --from=builder /code/skyhook-agent/dist/* /skyhook-agent-wheels
42+
FROM nvcr.io/nvidia/distroless/python:3.12-v3.4.10
3743

38-
RUN pip install /skyhook-agent-wheels/skyhook_agent*.whl
44+
# Copy the installed packages and scripts from builder
45+
COPY --from=builder /code/venv/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
46+
COPY --from=builder /code/venv/bin/controller /usr/local/bin/
3947

40-
ENTRYPOINT [ "controller" ]
48+
# Use Python to run the controller script
49+
ENTRYPOINT [ "python", "-m", "skyhook_agent.controller" ]

0 commit comments

Comments
 (0)