Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building a totally static go binary. #43801

Closed
hongyi-zhao opened this issue Jan 20, 2021 · 1 comment
Closed

Building a totally static go binary. #43801

hongyi-zhao opened this issue Jan 20, 2021 · 1 comment

Comments

@hongyi-zhao
Copy link

hongyi-zhao commented Jan 20, 2021

On Ubuntu 20.10, I use the following steps to build the go binary:

$ sudo apt-get build-dep -y golang
$ git clone https://github.com/golang/go.git go.git
$ cd go.git/src
$ ./make.bash
$ cd ../
$ ldd bin/go
	linux-vdso.so.1 (0x00007ffef27ee000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f540e41d000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f540e233000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f540e475000)

It seems that it needs some distribution relevant dependencies for working correctly. Thus, I want to know whether I can build a totally static go binary so that it can run under other Linux distributions.

Regards,
HY

@mdlayher
Copy link
Member

Please see https://github.com/golang/go/wiki/Questions. Closing.

@golang golang locked and limited conversation to collaborators Jan 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants