-
Notifications
You must be signed in to change notification settings - Fork 640
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
Include 'generator' in binary distributions #223
Comments
Hello, I saw on your issue prometheus/snmp_exporter#120 that you created this Dockerfile. I modified it so it's lighter (using multi-stage builds), but also configurable like @brian-brazil advised it. In addition I used the idea from prometheus/snmp_exporter#223 to statically compile it. I hope it'll help and maybe integrate it later to the original repo!
We now have support for extldflags in promu. I've tested this with the latest mater and works well. Once we have a new release of promu, we can do this. |
golang #26492 proposes a native |
FYI, you now also need to add
|
|
Any update on this? |
++ thanks |
The underlying go issue still hasn't been fixed, you can track it here: golang/go#26492 |
There are convenient binary distributions of snmp_exporter, but these do not contain
generator
orgenerator.yml
The documentation says:
However, there are a number of posts 1 2 3 which show how to generate static go binaries.
I was able to build a static
generate
binary for Linux x86 using go 1.8.3 and:It is about 10M instead of 6.5M. ldd shows it is not a dynamically linked executable, and
./generator generate
runs successfully.I have not experimented with
CGO_ENABLED=0
or tried any other architectures.(Without the
-lcrypto
flag there are errors about not being able to find various crypto functions, and if you add only that, it complains about not being able to find various dlopen-type functions)The text was updated successfully, but these errors were encountered: