diff --git a/deploy/iso/Dockerfile b/deploy/iso/Dockerfile index 00c566f33b..36ee9c4084 100644 --- a/deploy/iso/Dockerfile +++ b/deploy/iso/Dockerfile @@ -24,6 +24,7 @@ ENV DOCKER_SHA 8824f8a67fbe55d1e52dcbebc74219ba8090006e ADD nsenter $ROOTFS/usr/bin/ ADD socat $ROOTFS/usr/bin ADD ethtool $ROOTFS/usr/bin +ADD conntrack $ROOTFS/usr/bin # Add addons ADD addon-manager.yaml $ROOTFS/etc/kubernetes/manifests/ diff --git a/deploy/iso/Dockerfile.conntrack b/deploy/iso/Dockerfile.conntrack new file mode 100644 index 0000000000..7ef07ebb17 --- /dev/null +++ b/deploy/iso/Dockerfile.conntrack @@ -0,0 +1,18 @@ +# Copyright 2016 The Kubernetes Authors All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM golang:1.6 +RUN apt-get -qq update && apt-get -qq install curl make pkg-config gcc flex bison bzip2 +ADD conntrack.sh /go/ +RUN /go/conntrack.sh diff --git a/deploy/iso/build.sh b/deploy/iso/build.sh index d0b9a01904..f1a67e2188 100755 --- a/deploy/iso/build.sh +++ b/deploy/iso/build.sh @@ -33,11 +33,16 @@ docker build -t socat -f Dockerfile.socat . docker run socat cat socat > $tmpdir/socat chmod +x $tmpdir/socat -# Get ethotool +# Get ethtool docker build -t ethtool -f Dockerfile.ethtool . docker run ethtool cat ethtool > $tmpdir/ethtool chmod +x $tmpdir/ethtool +# Get conntrack +docker build -t conntrack -f Dockerfile.conntrack . +docker run conntrack cat conntrack > $tmpdir/conntrack +chmod +x $tmpdir/conntrack + # Do the build. docker build -t iso . diff --git a/deploy/iso/conntrack.sh b/deploy/iso/conntrack.sh new file mode 100755 index 0000000000..4c345d4358 --- /dev/null +++ b/deploy/iso/conntrack.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Copyright 2016 The Kubernetes Authors All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e + +PACKAGES="libmnl-1.0.3 libnfnetlink-1.0.1 libnetfilter_cttimeout-1.0.0 libnetfilter_cthelper-1.0.0 libnetfilter_queue-1.0.2 libnetfilter_conntrack-1.0.4" +CONNTRACK=conntrack-tools-1.4.2 + +fetch() { + curl -s -S http://www.netfilter.org/projects/${1%-*}/files/$1.tar.bz2 | tar xj +} + +for PACKAGE in $PACKAGES; do + fetch $PACKAGE + (cd $PACKAGE; ./configure && make LDFLAGS=-static install) +done + +fetch $CONNTRACK +(cd $CONNTRACK; ./configure && make LDFLAGS=-static && rm -f src/conntrack && make LDFLAGS=-all-static) +cp $CONNTRACK/src/conntrack /go