Skip to content

Commit

Permalink
build: fixing image build
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Tal-or committed Jun 12, 2023
1 parent c9cb61f commit 5414701
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM golang
FROM golang:1.20
COPY build/bin/mixedcpu /bin/mixedcpu
ENTRYPOINT [ "/bin/mixedcpu" ]
ENTRYPOINT [ "/bin/mixedcpu" ]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ COVERAGE_PATH := $(BUILD_PATH)/coverage
PLUGIN = $(BIN_PATH)/mixedcpu

COMMONENVVAR = GOOS=linux GOARCH=amd64
BUILDENVVAR = CGO_ENABLED=1
BUILDENVVAR = CGO_ENABLED=0
RUNTIME ?= docker
REPOOWNER ?= openshift-kni
IMAGENAME ?= mixed-cpu-node-plugin
Expand Down Expand Up @@ -83,7 +83,7 @@ mkdir:
mkdir -p build/bin || true

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

build-check:
$(Q)$(GO_BUILD) -v $(GO_MODULES)
Expand Down
4 changes: 2 additions & 2 deletions deployment/kustomize/base/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ spec:
spec:
containers:
- name: mixedcpus-plugin
image: quay.io/titzhak/mixedcpus
image: quay.io/titzhak/mixed-cpu-node-plugin
imagePullPolicy: Always
command:
- /bin/mixedcpus
- /bin/mixedcpu
args:
- --name=mixedcpus
- --idx=99
Expand Down

0 comments on commit 5414701

Please sign in to comment.