Skip to content

Commit

Permalink
Merge pull request moby#801 from dotcloud/build_docker_static
Browse files Browse the repository at this point in the history
* Makefile: Add link flags in order to link statically and without debug symbols
  • Loading branch information
Victor Vieux committed Jun 21, 2013
2 parents dc84700 + db60337 commit 5ccde4d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif
GIT_COMMIT = $(shell git rev-parse --short HEAD)
GIT_STATUS = $(shell test -n "`git status --porcelain`" && echo "+CHANGES")

BUILD_OPTIONS = -ldflags "-X main.GITCOMMIT $(GIT_COMMIT)$(GIT_STATUS)"
BUILD_OPTIONS = -a -ldflags "-X main.GITCOMMIT $(GIT_COMMIT)$(GIT_STATUS) -d -w"

SRC_DIR := $(GOPATH)/src

Expand All @@ -33,7 +33,7 @@ all: $(DOCKER_BIN)

$(DOCKER_BIN): $(DOCKER_DIR)
@mkdir -p $(dir $@)
@(cd $(DOCKER_MAIN); go build $(GO_OPTIONS) $(BUILD_OPTIONS) -o $@)
@(cd $(DOCKER_MAIN); CGO_ENABLED=0 go build $(GO_OPTIONS) $(BUILD_OPTIONS) -o $@)
@echo $(DOCKER_BIN_RELATIVE) is created.

$(DOCKER_DIR):
Expand Down
2 changes: 1 addition & 1 deletion packaging/ubuntu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ VERSION=$(shell sed -En '0,/^\#\# /{s/^\#\# ([^ ]+).+/\1/p}' ../../CHANGELOG.md)

all:
# Compile docker. Used by dpkg-buildpackage.
cd src/${GITHUB_PATH}/docker; GOPATH=${CURDIR} go build
cd src/${GITHUB_PATH}/docker; GOPATH=${CURDIR} CGO_ENABLED=0 go build -a -ldflags '-d -w'

install:
# Used by dpkg-buildpackage
Expand Down

0 comments on commit 5ccde4d

Please sign in to comment.