Skip to content

Commit 06afc71

Browse files
committed
Merge pull request #91 from Xe/fix/static-binary
Defaultly build deisctl as a static binary
2 parents 2b93db0 + 322bc2f commit 06afc71

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM deis/base
2+
ENV CGO_ENABLED 0
23
ADD https://storage.googleapis.com/golang/go1.3.linux-amd64.tar.gz /tmp/
34
RUN tar -C /usr/local -xzf /tmp/go1.3.linux-amd64.tar.gz
45
RUN apt-get update && apt-get install -yq git mercurial
@@ -11,8 +12,7 @@ ADD deis-version /tmp/package/etc/deis-version
1112
ENV GOPATH /go:/go/src/github.com/deis/deisctl/Godeps/_workspace
1213
WORKDIR /go/src/github.com/deis/deisctl
1314
RUN go get github.com/tools/godep
14-
#RUN go get -v ./... && go install -v ./...
15-
RUN godep go install -v ./...
15+
RUN godep go install -v -a -ldflags '-s' ./...
1616
RUN mkdir -p /tmp/package/opt/bin && cp /go/bin/deisctl /tmp/package/opt/bin/deisctl
1717
RUN tar -C /tmp/package -czf /tmp/deisctl.tar.gz .
1818
ENTRYPOINT ["/go/bin/deisctl"]

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
COMPONENTS=builder cache controller database logger registry router
22

33
build:
4-
godep go build ./...
4+
CGO_ENABLED=0 godep go build -a -ldflags '-s' ./...
55

66
installer:
77
rm -rf dist && mkdir -p dist
8-
godep go build -a -o dist/deisctl .
8+
CGO_ENABLED=0 godep go build -a -ldflags '-s' -o dist/deisctl .
99
@if [ ! -d makeself ]; then git clone -b deisctl-hack https://github.com/deis/makeself.git; fi
1010
PATH=./makeself:$$PATH makeself.sh --bzip2 --nox11 --target /usr/local/bin dist \
1111
dist/deisctl-`cat deis-version`-`go env GOOS`-`go env GOARCH`.run "Deis Control Utility" \

0 commit comments

Comments
 (0)