blob: 3d95450b6f03cc9f3d4c1c52f4fda6fda1a95c43 [file] [log] [blame]
Keita NISHIMOTO3b8b9c02018-10-09 09:40:01 +09001# Copyright 2018 the original author or authors.
Zack Williams86f87202018-10-05 10:36:32 -07002#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
Keita NISHIMOTO3b8b9c02018-10-09 09:40:01 +09007# http://www.apache.org/licenses/LICENSE-2.0
Zack Williams86f87202018-10-05 10:36:32 -07008#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15# bbsim dockerfile
16
Keita NISHIMOTO3b8b9c02018-10-09 09:40:01 +090017ARG TAG=latest
18ARG REGISTRY=
19ARG REPOSITORY=
Zack Williams86f87202018-10-05 10:36:32 -070020
Keita NISHIMOTO3b8b9c02018-10-09 09:40:01 +090021#builder parent
22FROM ubuntu:16.04
Zack Williams86f87202018-10-05 10:36:32 -070023
Keita NISHIMOTO3b8b9c02018-10-09 09:40:01 +090024MAINTAINER Voltha Community <info@opennetworking.org>
Zack Williams86f87202018-10-05 10:36:32 -070025
Keita NISHIMOTO3b8b9c02018-10-09 09:40:01 +090026# Install required packages
27RUN apt-get update && apt-get install -y wget git make libpcap-dev gcc unzip
28ARG version="1.9.3."
29RUN wget https://storage.googleapis.com/golang/go${version}linux-amd64.tar.gz -P /tmp \
30 && tar -C /usr/local -xzf /tmp/go${version}linux-amd64.tar.gz \
31 && rm /tmp/go${version}linux-amd64.tar.gz
Zack Williams86f87202018-10-05 10:36:32 -070032
Keita NISHIMOTO3b8b9c02018-10-09 09:40:01 +090033# Set PATH
34ENV GOPATH $HOME/go
35ENV PATH /usr/local/go/bin:/go/bin:$PATH
36
37# Copy source code
38RUN mkdir -p $GOPATH/src/gerrit.opencord.org/voltha-bbsim
39COPY . $GOPATH/src/gerrit.opencord.org/voltha-bbsim
40
41# Install golang protobuf and pcap support
42RUN wget https://github.com/google/protobuf/releases/download/v3.6.0/protoc-3.6.0-linux-x86_64.zip -P /tmp/ \
43&& unzip /tmp/protoc-3.6.0-linux-x86_64.zip -d /tmp/ \
44&& mv /tmp/bin/* /usr/local/bin/ \
45&& mv /tmp/include/* /usr/local/include/ \
46&& go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway \
47&& go get -u github.com/golang/protobuf/protoc-gen-go \
48&& go get -u github.com/google/gopacket/pcap \
49&& go get -u golang.org/x/net/context \
50&& go get -u google.golang.org/grpc
51
52# ... Install utilities & config
53RUN apt-get update && apt-get install -y wpasupplicant isc-dhcp-server
54COPY ./config/wpa_supplicant.conf /etc/wpa_supplicant/
55COPY ./config/isc-dhcp-server /etc/default/
56COPY ./config/dhcpd.conf /etc/dhcp/
57RUN mv /usr/sbin/dhcpd /usr/local/bin/ \
58&& mv /sbin/dhclient /usr/local/bin/
59
60WORKDIR $GOPATH/src/gerrit.opencord.org/voltha-bbsim
Zack Williams86f87202018-10-05 10:36:32 -070061RUN make bbsim
62