Skip to content

Commit

Permalink
Build improvements
Browse files Browse the repository at this point in the history
- ensure CGO is always off and netgo is always on
- add musl-dev (somehow cgo still gets dragged in)
- add .dockerignore files
  • Loading branch information
errordeveloper committed Dec 28, 2018
1 parent c356a9c commit 015e273
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Dockerfile
build
*.md
DCO
LICENSE*
3 changes: 1 addition & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ builds:
- main: ./cmd/eksctl
binary: eksctl
flags:
- -tags
- release
- -tags=netgo,release
env:
- CGO_ENABLED=0
ldflags:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ install-build-deps: ## Install dependencies (packages and tools)

.PHONY: build
build: ## Build eksctl
@go build -ldflags "-X $(version_pkg).gitCommit=$(git_commit) -X $(version_pkg).builtAt=$(built_at)" ./cmd/eksctl
@CGO_ENABLED=0 go build -v -tags netgo -ldflags "-X $(version_pkg).gitCommit=$(git_commit) -X $(version_pkg).builtAt=$(built_at)" ./cmd/eksctl

##@ Testing & CI

Expand Down
2 changes: 2 additions & 0 deletions build/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Dockerfile
vendor
3 changes: 2 additions & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ RUN apk add --no-cache \
git \
make \
gcc \
musl-dev \
&& true

ENV DEP_VERSION v0.5.0
Expand All @@ -24,6 +25,6 @@ RUN dep ensure
RUN ./install.sh

WORKDIR $EKSCTL_BUILD/vendor/github.com/goreleaser/goreleaser
RUN CGO_ENABLED=0 make build && go install
RUN make build && go install

WORKDIR $GOPATH

0 comments on commit 015e273

Please sign in to comment.