GoogleCloudPlatform / docker-credential-gcr

A Docker credential helper for GCR users
https://gcr.io
Apache License 2.0
294 stars 92 forks source link

Use pure go to achieve static linkage #32

Closed dekkagaijin closed 6 years ago

dekkagaijin commented 6 years ago

Fixes https://github.com/GoogleCloudPlatform/docker-credential-gcr/issues/31

Signed-off-by: Jake Sanders jsand@google.com

dekkagaijin commented 6 years ago

FYI here's the dump I get when I use static = "on", instead.

/usr/local/google/home/jsand/.cache/bazel/_bazel_jsand/ba7f50d4e9457e937e2d9df5ed5abf4a/bazel-sandbox/681906055626777699/execroot/__main__/bazel-out/k8-fastbuild/bin/external/io_bazel_rules_go/linux_amd64_stripped/stdlib~/src/os/user/cgo_lookup_unix.go:38: warning: Using 'getgrgid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/google/home/jsand/.cache/bazel/_bazel_jsand/ba7f50d4e9457e937e2d9df5ed5abf4a/bazel-sandbox/681906055626777699/execroot/__main__/bazel-out/k8-fastbuild/bin/external/io_bazel_rules_go/linux_amd64_stripped/stdlib~/src/os/user/cgo_lookup_unix.go:43: warning: Using 'getgrnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/google/home/jsand/.cache/bazel/_bazel_jsand/ba7f50d4e9457e937e2d9df5ed5abf4a/bazel-sandbox/681906055626777699/execroot/__main__/bazel-out/k8-fastbuild/bin/external/io_bazel_rules_go/linux_amd64_stripped/stdlib~/src/os/user/cgo_lookup_unix.go:33: warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/google/home/jsand/.cache/bazel/_bazel_jsand/ba7f50d4e9457e937e2d9df5ed5abf4a/bazel-sandbox/681906055626777699/execroot/__main__/bazel-out/k8-fastbuild/bin/external/io_bazel_rules_go/linux_amd64_stripped/stdlib~/src/os/user/cgo_lookup_unix.go:28: warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/google/home/jsand/.cache/bazel/_bazel_jsand/ba7f50d4e9457e937e2d9df5ed5abf4a/bazel-sandbox/681906055626777699/execroot/__main__/bazel-out/k8-fastbuild/bin/external/io_bazel_rules_go/linux_amd64_stripped/stdlib~/src/os/user/getgrouplist_unix.go:15: warning: Using 'getgrouplist' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
cgo-gcc-prolog:46: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
cgo-gcc-prolog:99: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
Target //:docker-credential-gcr up-to-date:
  bazel-bin/linux_amd64_stripped/docker-credential-gcr
mattmoor commented 6 years ago

FYI, this is exactly what you want.

dekkagaijin commented 6 years ago

@mattmoor "this" being the submitted PR or the errors for static = "on"?

mattmoor commented 6 years ago

pure = "on" is what you want to build with Bazel as if you were using: CGO_ENABLED=0 go build ...

dekkagaijin commented 6 years ago

good to know, thanks