refactoring Dockerfile
[ovn4nfv-k8s-plugin.git] / build / Dockerfile
1 FROM ubuntu:18.04
2
3 ARG HTTP_PROXY=${HTTP_PROXY}
4 ARG HTTPS_PROXY=${HTTPS_PROXY}
5
6 ENV http_proxy $HTTP_PROXY
7 ENV https_proxy $HTTPS_PROXY
8 ENV no_proxy $NO_PROXY
9
10 RUN apt-get update && apt-get install -y -qq apt-transport-https make curl net-tools iproute2 \
11  && echo "deb https://packages.wand.net.nz bionic ovs-2.10" >  /etc/apt/sources.list.d/ovs.list \
12  && curl https://packages.wand.net.nz/keyring.gpg -o /etc/apt/trusted.gpg.d/wand.gpg \
13  && apt-get update && apt install -y -qq ovn-common openvswitch-common openvswitch-switch
14
15 ENV GOLANG_VERSION 1.14.1
16 RUN curl -sSL https://storage.googleapis.com/golang/go$GOLANG_VERSION.linux-amd64.tar.gz \
17         | tar -v -C /usr/local -xz
18
19 ENV PATH /usr/local/go/bin:$PATH
20 RUN mkdir -p /go/src /go/bin && chmod -R 777 /go
21 ENV GOROOT /usr/local/go
22 ENV GOPATH /go
23 ENV PATH /go/bin:$PATH
24
25 WORKDIR /go/src/github.com/opnfv/ovn4nfv-k8s-plugin
26 COPY . .
27 RUN make all
28
29 ENV OPERATOR=/usr/local/bin/nfn-operator \
30     AGENT=/usr/local/bin/nfn-agent \
31     USER_UID=1001 \
32     USER_NAME=nfn-operator
33
34 RUN cp -r build/bin/* /usr/local/bin/
35
36 ENTRYPOINT ["entrypoint"]