Skip to content

Commit 5414701

Browse files
committed
build: fixing image build
Due to recent changes, the plugin image build has failed. The following changes has been added: 1. Fixing the command name in the DaemonSet spec 2. Pin golang to 1.20 3. Running the go build command with the right arguments 4. changing CGO_ENABLED=0 - The binary failed to execute and complains about GLIBC_2.32 not found. Running with CGO_ENABLED=0 build a binary that doesn't depend on glibc: golang/go#57328 (comment) Signed-off-by: Talor Itzhak <[email protected]>
1 parent c9cb61f commit 5414701

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
FROM golang
1+
FROM golang:1.20
22
COPY build/bin/mixedcpu /bin/mixedcpu
3-
ENTRYPOINT [ "/bin/mixedcpu" ]
3+
ENTRYPOINT [ "/bin/mixedcpu" ]

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ COVERAGE_PATH := $(BUILD_PATH)/coverage
4040
PLUGIN = $(BIN_PATH)/mixedcpu
4141

4242
COMMONENVVAR = GOOS=linux GOARCH=amd64
43-
BUILDENVVAR = CGO_ENABLED=1
43+
BUILDENVVAR = CGO_ENABLED=0
4444
RUNTIME ?= docker
4545
REPOOWNER ?= openshift-kni
4646
IMAGENAME ?= mixed-cpu-node-plugin
@@ -83,7 +83,7 @@ mkdir:
8383
mkdir -p build/bin || true
8484

8585
build-plugin: mkdir
86-
$(GO_BUILD) -o $(PLUGIN) ./cmd/main.go
86+
$(COMMONENVVAR) $(BUILDENVVAR) $(GO_BUILD) -o $(PLUGIN) ./cmd/main.go
8787

8888
build-check:
8989
$(Q)$(GO_BUILD) -v $(GO_MODULES)

deployment/kustomize/base/daemonset.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ spec:
1313
spec:
1414
containers:
1515
- name: mixedcpus-plugin
16-
image: quay.io/titzhak/mixedcpus
16+
image: quay.io/titzhak/mixed-cpu-node-plugin
1717
imagePullPolicy: Always
1818
command:
19-
- /bin/mixedcpus
19+
- /bin/mixedcpu
2020
args:
2121
- --name=mixedcpus
2222
- --idx=99

0 commit comments

Comments
 (0)