refactoring Dockerfile 41/69841/3 v0.1.0
authorKuralamudhan Ramakrishan <kuralamudhan.ramakrishnan@intel.com>
Wed, 25 Mar 2020 19:53:22 +0000 (19:53 +0000)
committerKuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>
Thu, 26 Mar 2020 07:14:36 +0000 (07:14 +0000)
- building with latest golang version v1.14
- Removing the dependence of CI golang version

Signed-off-by: Kuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>
Change-Id: Id1ddd154a5e5cf00937ed5adbb7cd8a90d800447

build/Dockerfile

index 94a83aa..9530772 100644 (file)
@@ -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"]