Skip to content

Commit a448c5c

Browse files
committed
Merge pull request #3133 from aledbf/fix_go_static_binaries
fix(go): go 1.4 static binaries
2 parents 41d9118 + 7c4fc31 commit a448c5c

8 files changed

Lines changed: 9 additions & 9 deletions

File tree

builder/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ BINARY_DEST_DIR := image/bin
1515

1616
build: check-docker
1717
for i in $(BINARIES); do \
18-
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 godep go build -a -v -ldflags '-s' -o $(BINARY_DEST_DIR)/$$i bin/$$i.go || exit 1; \
18+
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 godep go build -a -installsuffix cgo -v -ldflags '-s' -o $(BINARY_DEST_DIR)/$$i bin/$$i.go || exit 1; \
1919
done
2020
docker build -t $(IMAGE) image
2121

cache/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ BUILD_IMAGE = $(COMPONENT)-build
1313
BINARY_DEST_DIR = image/bin
1414

1515
build: check-docker
16-
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 godep go build -a -v -ldflags '-s' -o $(BINARY_DEST_DIR)/boot main.go || exit 1
16+
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 godep go build -a -installsuffix cgo -v -ldflags '-s' -o $(BINARY_DEST_DIR)/boot main.go || exit 1
1717
docker build -t $(BUILD_IMAGE) .
1818
docker cp `docker run -d $(BUILD_IMAGE)`:/usr/local/bin/redis-server $(BINARY_DEST_DIR)/
1919
docker build -t $(IMAGE) image

contrib/bumpver/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
build:
2-
CGO_ENABLED=0 godep go build -a -ldflags '-s' .
2+
CGO_ENABLED=0 godep go build -a -installsuffix cgo -ldflags '-s' .
33

44
upx:
55
upx -9 --brute bumpver && upx -t bumpver

deisctl/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ COMPONENT = $(notdir $(repo_path))
1111
IMAGE = $(IMAGE_PREFIX)/$(COMPONENT):$(BUILD_TAG)
1212

1313
build:
14-
CGO_ENABLED=0 godep go build -a -ldflags '-s' .
14+
CGO_ENABLED=0 godep go build -a -installsuffix cgo -ldflags '-s' .
1515

1616
installer:
1717
rm -rf dist && mkdir -p dist
18-
CGO_ENABLED=0 godep go build -a -ldflags '-s' -o dist/deisctl .
18+
CGO_ENABLED=0 godep go build -a -installsuffix cgo -ldflags '-s' -o dist/deisctl .
1919
@if [ ! -d makeself ]; then git clone -b single-binary https://github.com/deis/makeself.git; fi
2020
PATH=./makeself:$$PATH BINARY=deisctl makeself.sh --bzip2 --current --nox11 dist \
2121
dist/deisctl-`cat deis-version`-`go env GOOS`-`go env GOARCH`.run "Deis Control Utility" \

logger/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ DEV_IMAGE = $(DEV_REGISTRY)/$(IMAGE)
1414
BINARY_DEST_DIR = image/bin
1515

1616
build: check-docker
17-
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 godep go build -a -v -ldflags '-s' -o $(BINARY_DEST_DIR)/logger github.com/deis/deis/logger || exit 1
17+
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 godep go build -a -installsuffix cgo -v -ldflags '-s' -o $(BINARY_DEST_DIR)/logger github.com/deis/deis/logger || exit 1
1818
docker build -t $(IMAGE) image
1919

2020
clean: check-docker check-registry

logspout/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RELEASE_IMAGE := $(DOCKER_IMAGE):$(BUILD_TAG)
1313
DEV_DOCKER_IMAGE := $(DEV_REGISTRY)/$(RELEASE_IMAGE)
1414

1515
build: check-docker
16-
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 godep go build -a -v -ldflags '-s' -o image/logspout
16+
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 godep go build -a -installsuffix cgo -v -ldflags '-s' -o image/logspout
1717
docker build -t $(RELEASE_IMAGE) image
1818

1919
clean:

publisher/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ REMOTE_IMAGE := $(REGISTRY)/$(RELEASE_IMAGE)
1414
BINARY_DEST_DIR = image/bin
1515

1616
build: check-docker
17-
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 godep go build -a -v -ldflags '-s' -o $(BINARY_DEST_DIR)/publisher github.com/deis/deis/publisher || exit 1
17+
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 godep go build -a -installsuffix cgo -v -ldflags '-s' -o $(BINARY_DEST_DIR)/publisher github.com/deis/deis/publisher || exit 1
1818
docker build -t $(RELEASE_IMAGE) image
1919

2020
clean: check-docker check-registry

router/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ RUN go get github.com/tools/godep
1414

1515
ADD . /go/src/github.com/deis/deis/router/
1616

17-
RUN CGO_ENABLED=0 godep go build -a -ldflags '-s' boot.go
17+
RUN CGO_ENABLED=0 godep go build -a -installsuffix cgo -ldflags '-s' boot.go
1818

1919
RUN cp /go/src/github.com/deis/deis/router/boot /go/bin/boot

0 commit comments

Comments
 (0)