From 342d8470b54ca175756d0216c9f5294fd69746ec Mon Sep 17 00:00:00 2001 From: Kuralamudhan Ramakrishan Date: Wed, 25 Mar 2020 19:53:22 +0000 Subject: [PATCH] refactoring Dockerfile - building with latest golang version v1.14 - Removing the dependence of CI golang version Signed-off-by: Kuralamudhan Ramakrishnan Change-Id: Id1ddd154a5e5cf00937ed5adbb7cd8a90d800447 --- build/Dockerfile | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index 94a83aa..9530772 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -7,22 +7,30 @@ ENV http_proxy $HTTP_PROXY ENV https_proxy $HTTPS_PROXY ENV no_proxy $NO_PROXY -RUN apt-get update && apt-get install -y -qq apt-transport-https curl \ - && echo "deb https://packages.wand.net.nz xenial main" > /etc/apt/sources.list.d/wand.list \ +RUN apt-get update && apt-get install -y -qq apt-transport-https make curl net-tools iproute2 \ + && echo "deb https://packages.wand.net.nz bionic ovs-2.10" > /etc/apt/sources.list.d/ovs.list \ && curl https://packages.wand.net.nz/keyring.gpg -o /etc/apt/trusted.gpg.d/wand.gpg \ - && apt-get update && apt install -y -qq ovn-common + && apt-get update && apt install -y -qq ovn-common openvswitch-common openvswitch-switch +ENV GOLANG_VERSION 1.14.1 +RUN curl -sSL https://storage.googleapis.com/golang/go$GOLANG_VERSION.linux-amd64.tar.gz \ + | tar -v -C /usr/local -xz + +ENV PATH /usr/local/go/bin:$PATH +RUN mkdir -p /go/src /go/bin && chmod -R 777 /go +ENV GOROOT /usr/local/go +ENV GOPATH /go +ENV PATH /go/bin:$PATH + +WORKDIR /go/src/github.com/opnfv/ovn4nfv-k8s-plugin +COPY . . +RUN make all ENV OPERATOR=/usr/local/bin/nfn-operator \ AGENT=/usr/local/bin/nfn-agent \ USER_UID=1001 \ USER_NAME=nfn-operator -# install operator binary -COPY bin/nfn-operator ${OPERATOR} - -COPY bin /usr/local/bin - -ENTRYPOINT ["/usr/local/bin/entrypoint"] - +RUN cp -r build/bin/* /usr/local/bin/ +ENTRYPOINT ["entrypoint"] -- 2.16.6