Skip to content

Commit

Permalink
Revert "Enable CGO at build time (#133)"
Browse files Browse the repository at this point in the history
This reverts commit de0954c.
  • Loading branch information
damyan committed May 16, 2024
1 parent 709188a commit e59f9b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ARG TARGETARCH

RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
CGO_ENABLED=1 GOOS=$TARGETOS GOARCH=$TARGETARCH GO111MODULE=on go build -ldflags="-s -w" -a -o fedhcp main.go
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH GO111MODULE=on go build -ldflags="-s -w" -a -o fedhcp main.go

FROM debian:stable as installer

Expand Down
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest

GITHUB_PAT_PATH ?=
ifeq (,$(GITHUB_PAT_PATH))
GITHUB_PAT_MOUNT ?=
else
GITHUB_PAT_MOUNT ?= --secret id=github_pat,src=$(GITHUB_PAT_PATH)
endif

.PHONY: target/fedhcp

all: target/fedhcp

target/fedhcp:
mkdir -p target
CGO_ENABLED=1 go build -o target/fedhcp .
CGO_ENABLED=0 go build -o target/fedhcp .

clean:
rm -rf target
Expand Down

0 comments on commit e59f9b7

Please sign in to comment.