Keita NISHIMOTO | 3b8b9c0 | 2018-10-09 09:40:01 +0900 | [diff] [blame] | 1 | # Copyright 2018 the original author or authors. |
Zack Williams | 86f8720 | 2018-10-05 10:36:32 -0700 | [diff] [blame] | 2 | # |
| 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 NISHIMOTO | 3b8b9c0 | 2018-10-09 09:40:01 +0900 | [diff] [blame] | 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
Zack Williams | 86f8720 | 2018-10-05 10:36:32 -0700 | [diff] [blame] | 8 | # |
| 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 NISHIMOTO | 3b8b9c0 | 2018-10-09 09:40:01 +0900 | [diff] [blame] | 17 | ARG TAG=latest |
| 18 | ARG REGISTRY= |
| 19 | ARG REPOSITORY= |
Zack Williams | 86f8720 | 2018-10-05 10:36:32 -0700 | [diff] [blame] | 20 | |
Keita NISHIMOTO | 3b8b9c0 | 2018-10-09 09:40:01 +0900 | [diff] [blame] | 21 | #builder parent |
| 22 | FROM ubuntu:16.04 |
Zack Williams | 86f8720 | 2018-10-05 10:36:32 -0700 | [diff] [blame] | 23 | |
Keita NISHIMOTO | 3b8b9c0 | 2018-10-09 09:40:01 +0900 | [diff] [blame] | 24 | MAINTAINER Voltha Community <info@opennetworking.org> |
Zack Williams | 86f8720 | 2018-10-05 10:36:32 -0700 | [diff] [blame] | 25 | |
Keita NISHIMOTO | 3b8b9c0 | 2018-10-09 09:40:01 +0900 | [diff] [blame] | 26 | # Install required packages |
| 27 | RUN apt-get update && apt-get install -y wget git make libpcap-dev gcc unzip |
| 28 | ARG version="1.9.3." |
| 29 | RUN 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 Williams | 86f8720 | 2018-10-05 10:36:32 -0700 | [diff] [blame] | 32 | |
Keita NISHIMOTO | 3b8b9c0 | 2018-10-09 09:40:01 +0900 | [diff] [blame] | 33 | # Set PATH |
| 34 | ENV GOPATH $HOME/go |
| 35 | ENV PATH /usr/local/go/bin:/go/bin:$PATH |
| 36 | |
| 37 | # Copy source code |
| 38 | RUN mkdir -p $GOPATH/src/gerrit.opencord.org/voltha-bbsim |
| 39 | COPY . $GOPATH/src/gerrit.opencord.org/voltha-bbsim |
| 40 | |
| 41 | # Install golang protobuf and pcap support |
| 42 | RUN 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 |
| 53 | RUN apt-get update && apt-get install -y wpasupplicant isc-dhcp-server |
| 54 | COPY ./config/wpa_supplicant.conf /etc/wpa_supplicant/ |
| 55 | COPY ./config/isc-dhcp-server /etc/default/ |
| 56 | COPY ./config/dhcpd.conf /etc/dhcp/ |
| 57 | RUN mv /usr/sbin/dhcpd /usr/local/bin/ \ |
| 58 | && mv /sbin/dhclient /usr/local/bin/ |
| 59 | |
| 60 | WORKDIR $GOPATH/src/gerrit.opencord.org/voltha-bbsim |
Zack Williams | 86f8720 | 2018-10-05 10:36:32 -0700 | [diff] [blame] | 61 | RUN make bbsim |
| 62 | |