File tree 3 files changed +8
-4
lines changed
3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export GOROOT=$(BIN_DIR)/go/
13
13
export GOBIN = $(GOROOT ) /bin/
14
14
export PATH := $(GOBIN ) :$(PATH ) :$(BIN_DIR )
15
15
GOPATH = $(CURDIR ) /.gopath
16
+ GOARCH ?= amd64
16
17
ORG_PATH = github.com/k8snetworkplumbingwg
17
18
PACKAGE = ovs-cni
18
19
OCI_BIN ?= $(shell if podman ps >/dev/null 2>&1; then echo podman; elif docker ps >/dev/null 2>&1; then echo docker; fi)
@@ -44,7 +45,7 @@ lint: $(GO) $(GOLANGCI)
44
45
$(GOLANGCI ) run
45
46
46
47
build-% : $(GO )
47
- cd cmd/$* && $(GO ) fmt && $(GO ) vet && GOOS=linux GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on $(GO ) build -tags no_openssl -mod vendor
48
+ cd cmd/$* && $(GO ) fmt && $(GO ) vet && GOOS=linux GOARCH=$( GOARCH ) CGO_ENABLED=0 GO111MODULE=on $(GO ) build -tags no_openssl -mod vendor
48
49
49
50
format : $(GO )
50
51
$(GO ) fmt ./pkg/... ./cmd/...
@@ -74,7 +75,7 @@ functest: $(GO)
74
75
75
76
docker-build :
76
77
hack/get_version.sh > .version
77
- $(OCI_BIN ) build -t ${REGISTRY} /ovs-cni-plugin:${IMAGE_TAG} -f ./cmd/Dockerfile .
78
+ $(OCI_BIN ) build --build-arg goarch= ${GOARCH} - t ${REGISTRY} /ovs-cni-plugin:${IMAGE_TAG} -f ./cmd/Dockerfile .
78
79
79
80
docker-push :
80
81
$(OCI_BIN ) push ${TLS_SETTING} ${REGISTRY} /ovs-cni-plugin:${IMAGE_TAG}
Original file line number Diff line number Diff line change @@ -9,7 +9,9 @@ RUN dnf install -y golang-$(sed -En 's/^go +(.*+)$/\1/p' go.mod).*
9
9
COPY . .
10
10
11
11
ENV GOOS linux
12
- ENV GOARCH amd64
12
+ # Support overriding target GOARCH during `make docker-build`
13
+ ARG goarch=amd64
14
+ ENV GOARCH=$goarch
13
15
ENV CGO_ENABLED 0
14
16
ENV GOFLAGS -mod=vendor
15
17
Original file line number Diff line number Diff line change 2
2
3
3
destination=$1
4
4
version=1.18.4
5
- tarball=go$version .linux-amd64.tar.gz
5
+ arch=" $( arch | sed s' /aarch64/arm64/' | sed s' /x86_64/amd64/' ) "
6
+ tarball=go$version .linux-$arch .tar.gz
6
7
url=https://dl.google.com/go/
7
8
8
9
mkdir -p $destination
You can’t perform that action at this time.
0 commit comments