Download src/internal/dockerfile_agent from cacodex/beszel: direct link, hf CLI and curl.
- Browser
- Download file 893 Bytes
-
https://huggingface.co/spaces/cacodex/beszel/resolve/main/src/internal/dockerfile_agent
- Command line
-
hf download hf://spaces/cacodex/beszel/src/internal/dockerfile_agent
-
curl -L -o dockerfile_agent https://huggingface.co/spaces/cacodex/beszel/resolve/main/src/internal/dockerfile_agent
893 Bytes
| FROM --platform=$BUILDPLATFORM golang:alpine AS builder | |
| WORKDIR /app | |
| COPY ../go.mod ../go.sum ./ | |
| RUN go mod download | |
| # Copy source files | |
| COPY . ./ | |
| # Build | |
| ARG TARGETOS TARGETARCH | |
| RUN CGO_ENABLED=0 GOGC=75 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-w -s" -o /agent ./internal/cmd/agent | |
| RUN rm -rf /tmp/* | |
| # -------------------------- | |
| # Final image: default scratch-based agent | |
| # -------------------------- | |
| FROM scratch | |
| COPY --from=builder /agent /agent | |
| # this is so we don't need to create the /tmp directory in the scratch container | |
| COPY --from=builder /tmp /tmp | |
| # AMD GPU name lookup (used by agent on Linux when /usr/share/libdrm/amdgpu.ids is read) | |
| COPY --from=builder /app/agent/test-data/amdgpu.ids /usr/share/libdrm/amdgpu.ids | |
| # Ensure data persistence across container recreations | |
| VOLUME ["/var/lib/beszel-agent"] | |
| ENTRYPOINT ["/agent"] |