From e59f9b7053d693de23da0f294c5fc372801f82be Mon Sep 17 00:00:00 2001 From: Damyan Yordanov Date: Thu, 16 May 2024 10:34:14 +0200 Subject: [PATCH] Revert "Enable CGO at build time (#133)" This reverts commit de0954c2742ac8717120f36d10df781acba0214b. --- Dockerfile | 2 +- Makefile | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4bc19c6..d8aa959 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/Makefile b/Makefile index 95bb5ab..4497f7c 100644 --- a/Makefile +++ b/Makefile @@ -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