Skip to content

Commit

Permalink
Set CGO_ENABLED=0 to create statically linked binary
Browse files Browse the repository at this point in the history
  • Loading branch information
plukevdh committed Jul 3, 2019
1 parent ab0bda9 commit d21d6cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ COPY . .
ENV GOOS=linux
ENV GOARCH=amd64
ENV GO111MODULE=on
ENV CGO_ENABLED=0

RUN go get -d -v ./...
RUN go install -v ./...

VOLUME /go/src/terraform-provider-dmsnitch
VOLUME /go/src/terraform-provider-dmsnitch
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
build-linux:
build-linux: clean
docker build -t dms-builder .
docker run --rm -v "${PWD}":/go/src/terraform-provider-dmsnitch dms-builder go build

build:
build: clean
go get -d -v ./...
go install -v ./...
go build

install:
cp terraform-provider-dmsnitch ~/.terraform.d/plugins/

clean:
rm -f terraform-provider-dmsnitch

0 comments on commit d21d6cd

Please sign in to comment.