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: