From 8cf6ab92cf82bfc580c0d2045d195bd35e99cd34 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Sat, 23 Aug 2014 20:11:50 -0700 Subject: [PATCH] Use the 'purego' build tag, for cznic/zappy. Change-Id: I23ef7e3f269fd884f77e61276468e023697d4580 --- Dockerfile | 2 +- make.go | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8030066a5..5ac14f998 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,7 +38,7 @@ USER camli ENV GOPATH /gopath -RUN go install \ +RUN go install --tags=purego \ camlistore.org/server/camlistored \ camlistore.org/cmd/camput \ camlistore.org/cmd/camget \ diff --git a/make.go b/make.go index f87b046e4..cffefec3a 100644 --- a/make.go +++ b/make.go @@ -172,9 +172,9 @@ func main() { deleteUnwantedOldMirrorFiles(buildSrcDir, withCamlistored) } - tags := "" + tags := []string{"purego"} // for cznic/zappy if sql { - tags = "with_sqlite" + tags = append(tags, "with_sqlite") } baseArgs := []string{"install", "-v"} if *all { @@ -185,10 +185,12 @@ func main() { } ldFlags := "-X camlistore.org/pkg/buildinfo.GitInfo " + version if *dockerMode { - tags = "netgo" + // Use libc-free net package for a static binary. + // And -w appears to be required too. + tags = append(tags, "netgo") ldFlags = "-w " + ldFlags } - baseArgs = append(baseArgs, "--ldflags="+ldFlags, "--tags="+tags) + baseArgs = append(baseArgs, "--ldflags="+ldFlags, "--tags="+strings.Join(tags, ",")) // First install command: build just the final binaries, installed to a GOBIN // under /bin: