Skip to content

Commit

Permalink
build go with CGO_ENABLED=0 and for linux explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
Knappek committed Jun 22, 2019
1 parent 96210f9 commit 6bbe4e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
BUILD_DATE=$(shell date +%FT%T%z)
CRDS=$(shell echo deploy/crds/*_crd.yaml | sed 's/ / -f /g')
GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor)
GO := GOARCH=amd64 CGO_ENABLED=0 GOOS=linux go

VERSION?=latest
OLM_VERSION?=0.0.3
Expand Down Expand Up @@ -38,7 +39,7 @@ controller:

.PHONY: build
build:
go build -o $(PWD)/build/_output/bin/$(BINARY) -gcflags all=-trimpath=${GOPATH} -asmflags all=-trimpath=${GOPATH} github.com/$(GITHUB_USERNAME)/$(BINARY)/cmd/manager
$(GO) build -o $(PWD)/build/_output/bin/$(BINARY) -gcflags all=-trimpath=${GOPATH} -asmflags all=-trimpath=${GOPATH} github.com/$(GITHUB_USERNAME)/$(BINARY)/cmd/manager

docker-build:
docker build -f build/Dockerfile -t $(DOCKERHUB_USERNAME)/$(BINARY) .
Expand Down Expand Up @@ -86,6 +87,6 @@ fmt:

lint:
@which golint > /dev/null; if [ $$? -ne 0 ]; then \
go get -u golang.org/x/lint/golint; \
$(GO) get -u golang.org/x/lint/golint; \
fi
go list ./... | grep -v /vendor/ | xargs golint -set_exit_status
$(GO) list ./... | grep -v /vendor/ | xargs golint -set_exit_status
2 changes: 0 additions & 2 deletions build/bin/user_setup
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/bin/sh
set -x

dos2unix

# ensure $HOME exists and is accessible by group 0 (we don't know what the runtime UID will be)
mkdir -p ${HOME}
chown ${USER_UID}:0 ${HOME}
Expand Down

0 comments on commit 6bbe4e0

Please sign in to comment.