-
Notifications
You must be signed in to change notification settings - Fork 16
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
Linux compile on Debian 6. #1
Conversation
We used to compile on a recent ubuntu version, which is needed for cross-compiling to Windows and OS X. This poses the problem that it links against a relatively recent version of libc, so the resulting binary cannot work on older linux distributions. To work around this issue we tried to compile statically linked binaries. Unfortunately, statically linking against libc breaks in part the name resolution, in particular resolving the names from /etc/hosts. This pull requests makes 2 Docker images: one based on ubuntu for cross compiling to os x and windows and one based on debian 6 for compiling for Linux (both 32 and 64 bits versions). Libpcap continues to be statically linked for Linux. Because the Dockerfiles have drifted quite a bit from the versions from XGO, I moved them to this repository. This closes elastic/beats#225.
@@ -0,0 +1,18 @@ | |||
FROM tudorg/xgo-deb6-1.4.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we move this image to elastic/xog-deb6-1.4.2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the 'elastic' namespace on docker hub is ours :-(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least I don't know this guy: https://hub.docker.com/r/elastic/ I doesn't look like he needs it. Should we ask him?
Beat is taken: https://hub.docker.com/r/beat/
Beats is available: https://hub.docker.com/r/beats/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@electrical How did you do it in the past, did you use your personal account for hub.docker.com images?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm currently using my personal account indeed.
I'm hoping we will have an internal docker registry at some point for these kind of things
There are quite a few things commented out in the code. Not sure if you want to remove it or keep it in for the moment. |
|
||
FROM debian:6 | ||
|
||
MAINTAINER Péter Szilágyi <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
@ruflin, regarding the comments, the build.sh file from xgo-image and xgo-image-deb6 have a lot of code duplication between them. I'm thinking on how to reduce that, but I prefer to do it in another PR. I'll get rid of the commented out blocks then. |
@@ -0,0 +1,5 @@ | |||
#!/bin/sh | |||
|
|||
docker build -t tudorg/xgo-deb6-base base/ && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add --rm=true
to the build commands? this will remove the intermediate containers after a good build to save diskspace.
When |
It looks like |
@andrewkroh thanks, fixed. |
@andrewkroh Regarding the |
need to run 'make deps' and 'make xgo-image' before make will work. without running 'make xgo-image' did try to download the image for me. We might want to add some notes about building the image in the Readme or have a dependency on xgo-image in default target |
We used to compile on a recent ubuntu version, which is needed for
cross-compiling to Windows and OS X. This poses the problem that it links
against a relatively recent version of libc, so the resulting binary cannot work
on older linux distributions. To work around this issue we tried to compile
statically linked binaries. Unfortunately, statically linking against libc
breaks in part the name resolution, in particular resolving the names from
/etc/hosts.
This pull requests makes 2 Docker images: one based on ubuntu for cross
compiling to os x and windows and one based on debian 6 for compiling for Linux
(both 32 and 64 bits versions). Libpcap continues to be statically linked for
Linux.
Because the Dockerfiles have drifted quite a bit from the versions from XGO, I
moved them to this repository.
This closes elastic/beats#225.