Skip to content

Commit 3136c47

Browse files
committed
docker/ci: cross-compiler - use static
As we can't cross compile a dynamic skydive executable for now we're limited to a static executable for cross-architecture. ref: https://bugs.launchpad.net/ubuntu/+source/glib2.0/+bug/1784779 and https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/1784772 This static executable doesn't require the qemu trick to run a non-native apt-get to build a dynamic docker environment so we've reverted that change for now for now.
1 parent e5a6da6 commit 3136c47

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ contrib/vagrant/.vagrant/
1414
contrib/dev/.vagrant/
1515
contrib/snort/snortSkydive
1616
contrib/docker/skydive.*
17-
contrib/docker/qemu-*-static
1817
skydive.yml
1918
probe/ebpf/flow.o
2019
js/api.js

Makefile

+1-4
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,6 @@ rpm:
480480
.PHONY: docker-image
481481
docker-image: static
482482
cp $$GOPATH/bin/skydive contrib/docker/skydive.$$(uname -m)
483-
touch contrib/docker/qemu-$$(uname -m)-static
484483
docker build -t ${DOCKER_IMAGE}:${DOCKER_TAG} --build-arg ARCH=$$(uname -m) -f contrib/docker/Dockerfile contrib/docker/
485484

486485
.PHONY: docker-build
@@ -497,7 +496,6 @@ docker-build:
497496
skydive-compile
498497
docker cp skydive-compile-build:/root/go/bin/skydive contrib/docker/skydive.$$(uname -m)
499498
docker rm skydive-compile-build
500-
touch contrib/docker/qemu-$$(uname -m)-static
501499
docker build -t ${DOCKER_IMAGE}:${DOCKER_TAG} \
502500
--build-arg ARCH=$$(uname -m) \
503501
-f contrib/docker/Dockerfile contrib/docker/
@@ -519,11 +517,10 @@ docker-cross-build: ebpf.build
519517
skydive-crosscompile-${TARGET_GOARCH}
520518
docker cp skydive-crosscompile-build-${TARGET_GOARCH}:/root/go/bin/linux_${TARGET_GOARCH}/skydive contrib/docker/skydive.${TARGET_GOARCH}
521519
docker rm skydive-crosscompile-build-${TARGET_GOARCH}
522-
cp /usr/bin/qemu-${TARGET_GOARCH}-static contrib/docker || cp /bin/true contrib/docker/qemu-${TARGET_GOARCH}-static
523520
docker build -t ${DOCKER_IMAGE}:${DOCKER_TAG} \
524521
--build-arg ARCH=${TARGET_GOARCH} \
525522
$${BASE:+--build-arg BASE=$${BASE}} \
526-
-f contrib/docker/Dockerfile contrib/docker/
523+
-f contrib/docker/Dockerfile.static contrib/docker/
527524

528525
SKYDIVE_PROTO_FILES:= \
529526
flow/flow.proto \

contrib/docker/Dockerfile

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
ARG BASE=ubuntu:18.04
22
FROM $BASE
33
ARG ARCH=x86_64
4-
COPY qemu-$ARCH-static /usr/bin
54
RUN apt-get -y update \
65
&& apt-get -y install openvswitch-common libpcap0.8 libxml2 \
76
&& rm -rf /var/lib/apt/lists/*

contrib/docker/Dockerfile.static

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ARG BASE=ubuntu:18.04
2+
FROM $BASE
3+
ARG ARCH=x86_64
4+
COPY skydive.$ARCH /usr/bin/skydive
5+
COPY skydive.yml /etc/skydive.yml
6+
ENTRYPOINT ["/usr/bin/skydive", "--conf", "/etc/skydive.yml"]

0 commit comments

Comments
 (0)