From c94577e0f863846daadf7149c6f09cfc53b35684 Mon Sep 17 00:00:00 2001 From: Imcom Jin Date: Sat, 29 Sep 2018 15:27:55 +0800 Subject: [PATCH 1/2] fix deps docker build --- exabgp.py | 4 ++-- gobgp.py | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/exabgp.py b/exabgp.py index 9363b3c..b738190 100644 --- a/exabgp.py +++ b/exabgp.py @@ -28,7 +28,7 @@ def build_image(cls, force=False, tag='bgperf/exabgp', checkout='HEAD', nocache= FROM ubuntu:latest WORKDIR /root RUN apt-get update && apt-get install -qy git python python-setuptools gcc python-dev -RUN easy_install pip +RUN apt-get install -yq python-pip RUN git clone https://github.com/Exa-Networks/exabgp && \ (cd exabgp && git checkout {0} && pip install six && pip install -r requirements.txt && python setup.py install) RUN ln -s /root/exabgp /exabgp @@ -49,7 +49,7 @@ def build_image(cls, force=False, tag='bgperf/exabgp_mrtparse', checkout='HEAD', FROM ubuntu:latest WORKDIR /root RUN apt-get update && apt-get install -qy git python python-setuptools gcc python-dev -RUN easy_install pip +RUN apt-get install -yq python-pip RUN git clone https://github.com/Exa-Networks/exabgp && \ (cd exabgp && git checkout {0} && pip install six && pip install -r requirements.txt && python setup.py install) RUN ln -s /root/exabgp /exabgp diff --git a/gobgp.py b/gobgp.py index 02fe463..466269e 100644 --- a/gobgp.py +++ b/gobgp.py @@ -26,13 +26,10 @@ def __init__(self, host_dir, conf, image='bgperf/gobgp'): @classmethod def build_image(cls, force=False, tag='bgperf/gobgp', checkout='HEAD', nocache=False): cls.dockerfile = ''' -FROM golang:1.6 +FROM golang:1.10 WORKDIR /root -RUN go get -v github.com/osrg/gobgp/gobgpd -RUN go get -v github.com/osrg/gobgp/gobgp -RUN cd $GOPATH/src/github.com/osrg/gobgp && git checkout {0} -RUN go install github.com/osrg/gobgp/gobgpd -RUN go install github.com/osrg/gobgp/gobgp +RUN go get -v github.com/osrg/gobgp +RUN go install github.com/osrg/gobgp '''.format(checkout) super(GoBGP, cls).build_image(force, tag, nocache) From 0ea89546e36198a9f8173c64fd3737d7f2e6a198 Mon Sep 17 00:00:00 2001 From: Imcom Jin Date: Sat, 29 Sep 2018 17:03:21 +0800 Subject: [PATCH 2/2] ubuntu no longer has ip command installed by default --- base.py | 1 - exabgp.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/base.py b/base.py index 5bcbe9f..bc00f7b 100644 --- a/base.py +++ b/base.py @@ -145,7 +145,6 @@ def run(self, dckr_net_name='', rm=True): dckr.start(container=self.name) if len(ipv4_addresses) > 1: - # get the interface used by the first IP address already added by Docker dev = None res = self.local('ip addr') diff --git a/exabgp.py b/exabgp.py index b738190..ccd09c7 100644 --- a/exabgp.py +++ b/exabgp.py @@ -28,7 +28,7 @@ def build_image(cls, force=False, tag='bgperf/exabgp', checkout='HEAD', nocache= FROM ubuntu:latest WORKDIR /root RUN apt-get update && apt-get install -qy git python python-setuptools gcc python-dev -RUN apt-get install -yq python-pip +RUN apt-get install -yq python-pip iproute2 RUN git clone https://github.com/Exa-Networks/exabgp && \ (cd exabgp && git checkout {0} && pip install six && pip install -r requirements.txt && python setup.py install) RUN ln -s /root/exabgp /exabgp @@ -49,7 +49,7 @@ def build_image(cls, force=False, tag='bgperf/exabgp_mrtparse', checkout='HEAD', FROM ubuntu:latest WORKDIR /root RUN apt-get update && apt-get install -qy git python python-setuptools gcc python-dev -RUN apt-get install -yq python-pip +RUN apt-get install -yq python-pip iproute2 RUN git clone https://github.com/Exa-Networks/exabgp && \ (cd exabgp && git checkout {0} && pip install six && pip install -r requirements.txt && python setup.py install) RUN ln -s /root/exabgp /exabgp