-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tudor Golubenco
committed
Aug 4, 2015
0 parents
commit 598b85f
Showing
6 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.swp | ||
/build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
.PHONY: image | ||
image: | ||
docker build -t tudorg/beats-builder xgo-image/ | ||
|
||
.PHONY: packetbeat | ||
packetbeat: image | ||
cd build && xgo -image=tudorg/beats-builder -static \ | ||
-before-build=../xgo-scripts/before_build.sh \ | ||
github.com/elastic/packetbeat | ||
|
||
.PHONY: run-interactive | ||
run-interactive: | ||
docker run -t -i -v $(shell pwd):/build -v $(shell pwd)/xgo-scripts/:/scripts --entrypoint=bash tudorg/beats-builder | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM tudorg/xgo-latest | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
tsg
Contributor
|
||
|
||
MAINTAINER Tudor Golubenco <tudor@elastic.co> | ||
|
||
# Get libpcap binaries for linux | ||
RUN \ | ||
dpkg --add-architecture i386 && \ | ||
apt-get update && \ | ||
apt-get install -y libpcap0.8-dev | ||
|
||
RUN \ | ||
mkdir -p /libpcap && \ | ||
apt-get download libpcap0.8-dev:i386 && \ | ||
dpkg -x libpcap0.8-dev_*_i386.deb /libpcap/i386 && \ | ||
apt-get download libpcap0.8-dev && \ | ||
dpkg -x libpcap0.8-dev_*_amd64.deb /libpcap/amd64 && \ | ||
rm libpcap0.8-dev*.deb | ||
|
||
|
||
# Get libpcap binaries for win | ||
ENV WPDPACK_URL https://www.winpcap.org/install/bin/WpdPack_4_1_2.zip | ||
RUN \ | ||
./fetch.sh $WPDPACK_URL f5c80885bd48f07f41833d0f65bf85da1ef1727a && \ | ||
unzip `basename $WPDPACK_URL` -d /libpcap/win && \ | ||
rm `basename $WPDPACK_URL` | ||
|
||
# add patch for gopacket | ||
ADD gopacket_pcap.patch /gopacket_pcap.patch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
diff --git a/Godeps/_workspace/src/github.com/tsg/gopacket/pcap/pcap.go b/Godeps/_workspace/src/github. | ||
index d2465bb..7b23b84 100644 | ||
--- a/Godeps/_workspace/src/github.com/tsg/gopacket/pcap/pcap.go | ||
+++ b/Godeps/_workspace/src/github.com/tsg/gopacket/pcap/pcap.go | ||
@@ -8,12 +8,13 @@ | ||
package pcap | ||
|
||
/* | ||
-#cgo linux LDFLAGS: -lpcap | ||
+#cgo linux,386 LDFLAGS: /libpcap/i386/usr/lib/i386-linux-gnu/libpcap.a | ||
+#cgo linux,amd64 LDFLAGS: /libpcap/amd64/usr/lib/x86_64-linux-gnu/libpcap.a | ||
#cgo freebsd LDFLAGS: -lpcap | ||
#cgo darwin LDFLAGS: -lpcap | ||
-#cgo windows CFLAGS: -I C:/WpdPack/Include | ||
-#cgo windows,386 LDFLAGS: -L C:/WpdPack/Lib -lwpcap | ||
-#cgo windows,amd64 LDFLAGS: -L C:/WpdPack/Lib/x64 -lwpcap | ||
+#cgo windows CFLAGS: -I /libpcap/win/WpdPack/Include | ||
+#cgo windows,386 LDFLAGS: -L /libpcap/win/WpdPack/Lib -lwpcap | ||
+#cgo windows,amd64 LDFLAGS: -L /libpcap/win/WpdPack/Lib/x64 -lwpcap | ||
#include <stdlib.h> | ||
#include <pcap.h> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
|
||
PB_PATH=/go/src/github.com/elastic/packetbeat | ||
|
||
if [ -d $PB_PATH ]; then | ||
cd $PB_PATH | ||
patch -p1 < /gopacket_pcap.patch | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
PB_PATH=/go/src/github.com/elastic/packetbeat | ||
PB_TSG_PATH=/go/src/github.com/tsg/packetbeat | ||
|
||
mkdir -p `dirname $PB_PATH` | ||
ln -s $PB_TSG_PATH $PB_PATH | ||
|
||
if [ -d $PB_PATH ]; then | ||
cd $PB_PATH | ||
patch -p1 < /gopacket_pcap.patch | ||
fi |
@tsg Where does this image come from? I don't see it on docker hub. I suspect it needs to be built and tagged locally from https://github.com/tsg/xgo?