Add GPU-enabled build target in dockerfile_Agent (nvidia-smi support) (#898)

This commit is contained in:
dalton-baker
2025-08-03 11:31:26 -06:00
committed by GitHub
parent 8af3a0eb5b
commit 99c7f7bd8a
4 changed files with 40 additions and 7 deletions

View File

@@ -14,13 +14,21 @@ RUN CGO_ENABLED=0 GOGC=75 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-
RUN rm -rf /tmp/*
# ? -------------------------
FROM scratch
# --------------------------
# Final image: default scratch-based agent
# --------------------------
FROM scratch AS default-agent
COPY --from=builder /agent /agent
# this is so we don't need to create the
# /tmp directory in the scratch container
# this is so we don't need to create the /tmp directory in the scratch container
COPY --from=builder /tmp /tmp
ENTRYPOINT ["/agent"]
# --------------------------
# Final image: GPU-enabled agent with nvidia-smi
# --------------------------
FROM nvidia/cuda:12.9.0-base-ubuntu22.04 AS nvidia-agent
COPY --from=builder /agent /agent
COPY --from=builder /tmp /tmp
ENTRYPOINT ["/agent"]