add CGO_ENABLED=0 back to docker images / goreleaser config

This commit is contained in:
henrygd
2025-02-19 21:05:31 -05:00
parent 25b70af196
commit 79eb42d04d
3 changed files with 9 additions and 8 deletions

View File

@@ -10,8 +10,8 @@ builds:
- id: beszel - id: beszel
binary: beszel binary: beszel
main: cmd/hub/hub.go main: cmd/hub/hub.go
# env: env:
# - CGO_ENABLED=0 - CGO_ENABLED=0
goos: goos:
- linux - linux
- darwin - darwin
@@ -23,8 +23,8 @@ builds:
- id: beszel-agent - id: beszel-agent
binary: beszel-agent binary: beszel-agent
main: cmd/agent/agent.go main: cmd/agent/agent.go
# env: env:
# - CGO_ENABLED=0 - CGO_ENABLED=0
goos: goos:
- linux - linux
- darwin - darwin
@@ -84,8 +84,9 @@ nfpms:
- beszel-agent - beszel-agent
formats: formats:
- deb - deb
dependencies: # don't think this is needed with CGO_ENABLED=0
- libc6 # dependencies:
# - libc6
contents: contents:
- src: ../supplemental/debian/beszel-agent.service - src: ../supplemental/debian/beszel-agent.service
dst: lib/systemd/system/beszel-agent.service dst: lib/systemd/system/beszel-agent.service

View File

@@ -10,7 +10,7 @@ COPY internal ./internal
# Build # Build
ARG TARGETOS TARGETARCH ARG TARGETOS TARGETARCH
RUN GOGC=75 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-w -s" -o /agent ./cmd/agent RUN CGO_ENABLED=0 GOGC=75 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-w -s" -o /agent ./cmd/agent
# ? ------------------------- # ? -------------------------
FROM scratch FROM scratch

View File

@@ -22,7 +22,7 @@ RUN update-ca-certificates
# Build # Build
ARG TARGETOS TARGETARCH ARG TARGETOS TARGETARCH
RUN GOGC=75 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-w -s" -o /beszel ./cmd/hub RUN CGO_ENABLED=0 GOGC=75 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-w -s" -o /beszel ./cmd/hub
# ? ------------------------- # ? -------------------------
FROM scratch FROM scratch