-
Notifications
You must be signed in to change notification settings - Fork 78
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
Compiled releases are dynamically linked #83
Comments
It seems that go1.5 stabilises this:
More info: https://golang.org/cmd/cgo/ |
I believe this is a disparity between how
@keymon: what happens if you just |
With both Go 1.4 and Go 1.5 it compiles dynamically:
But with GO 1.5, you can get a static binary if you set the environment variable
Instead, with go 1.4, that environment variable does not work, and the workaround is using the
|
So, basically, if you compile it with Go 1.5 and export |
We have been using the version 0.13.0 of spruce, but compiling it in the Dockerfile because the release binary version did link to the debian/ubuntu libc. We were not pinning the git commit of the spruce code. But the upstream project has some changes that makes fail the build, probably new dependencies added which require the use of godep. As since geofffranks/spruce#83 the binary in the releases is OK and can work in a plain alpine, we can create a container pulling the binary release. This will simplify our container, make it smaller and pin the version number.
We have been using the version 0.13.0 of spruce, but compiling it in the Dockerfile because the release binary version did link to the debian/ubuntu libc. We were not pinning the git commit of the spruce code. But the upstream project has some changes that makes fail the build, probably new dependencies added which require the use of godep. As since geofffranks/spruce#83 the binary in the releases is OK and can work in a plain alpine, we can create a container pulling the binary release. This will simplify our container, make it smaller and pin the version number.
The releases published in this repo are dynamically linked:
This can be a problem in scenarios like docker alpine. For instance, this Dockerfile, if you build it:
It fails:
In this thread they discuss the topic and it seems that the magic solution is compile the binary with:
Which indeed generates a static file:
The text was updated successfully, but these errors were encountered: