mirror of
https://github.com/fankes/beszel.git
synced 2025-10-21 19:10:38 +08:00
Add GPU-enabled build target in dockerfile_Agent (nvidia-smi support) (#898)
This commit is contained in:
@@ -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"]
|
||||
|
Reference in New Issue
Block a user