Skip to content
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

Build conntrack as part of the iso. #157

Merged
merged 2 commits into from
Jun 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deploy/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update -y \
ca-certificates \
util-linux \
socat \
conntrack \
&& DEBIAN_FRONTEND=noninteractive apt-get upgrade -y \
&& DEBIAN_FRONTEND=noninteractive apt-get autoremove -y \
&& DEBIAN_FRONTEND=noninteractive apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Expand Down
1 change: 1 addition & 0 deletions deploy/iso/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
18 changes: 18 additions & 0 deletions deploy/iso/Dockerfile.conntrack
Original file line number Diff line number Diff line change
@@ -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
7 changes: 6 additions & 1 deletion deploy/iso/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 .

Expand Down
33 changes: 33 additions & 0 deletions deploy/iso/conntrack.sh
Original file line number Diff line number Diff line change
@@ -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