David K. Bainbridge | df9df63 | 2016-07-07 18:47:46 -0700 | [diff] [blame] | 1 | ## Copyright 2016 Open Networking Laboratory |
| 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 | ## |
| 7 | ## http://www.apache.org/licenses/LICENSE-2.0 |
| 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. |
David K. Bainbridge | f694f5a | 2016-06-10 16:21:27 -0700 | [diff] [blame] | 14 | FROM ubuntu:14.04 |
Murat Parlakisik | c3e1850 | 2016-08-08 15:36:13 -0700 | [diff] [blame] | 15 | MAINTAINER Open Networking Laboratory <info@onlab.us> |
David K. Bainbridge | f694f5a | 2016-06-10 16:21:27 -0700 | [diff] [blame] | 16 | |
| 17 | # Base image information borrowed by official golang wheezy Dockerfile |
| 18 | RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 19 | g++ \ |
| 20 | gcc \ |
| 21 | libc6-dev \ |
| 22 | make \ |
| 23 | curl \ |
| 24 | && rm -rf /var/lib/apt/lists/* |
| 25 | |
| 26 | ENV GOLANG_VERSION 1.6.2 |
| 27 | ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz |
| 28 | ENV GOLANG_DOWNLOAD_SHA256 e40c36ae71756198478624ed1bb4ce17597b3c19d243f3f0899bb5740d56212a |
| 29 | |
| 30 | RUN curl -kfsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \ |
| 31 | && echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \ |
| 32 | && tar -C /usr/local -xzf golang.tar.gz \ |
| 33 | && rm golang.tar.gz |
| 34 | |
| 35 | ENV GOPATH /go |
| 36 | ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH |
| 37 | |
| 38 | RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" |
| 39 | |
| 40 | # CORD Provisioner Dockerfile |
| 41 | WORKDIR $GOPATH |
| 42 | |
| 43 | RUN apt-get update && \ |
| 44 | apt-get install -y software-properties-common && \ |
| 45 | apt-add-repository ppa:ansible/ansible && \ |
| 46 | apt-get update -y -m && \ |
| 47 | apt-get install -y git ansible |
| 48 | |
| 49 | RUN mkdir -p /root/.ssh |
| 50 | COPY ssh-config /root/.ssh/config |
| 51 | |
| 52 | RUN mkdir -p /switchq |
| 53 | COPY vendors.json /switchq/vendors.json |
| 54 | |
| 55 | RUN go get github.com/tools/godep |
| 56 | ADD . $GOPATH/src/gerrit.opencord.com/maas/switchq |
| 57 | |
| 58 | WORKDIR $GOPATH/src/gerrit.opencord.com/maas/switchq |
David K. Bainbridge | a9c2e0a | 2016-07-01 18:33:50 -0700 | [diff] [blame] | 59 | RUN $GOPATH/bin/godep restore || true |
David K. Bainbridge | f694f5a | 2016-06-10 16:21:27 -0700 | [diff] [blame] | 60 | |
| 61 | WORKDIR $GOPATH |
| 62 | RUN go install gerrit.opencord.com/maas/switchq |
| 63 | |
David K. Bainbridge | de0d926 | 2016-09-13 20:12:06 -0700 | [diff] [blame^] | 64 | LABEL org.label-schema.name="switchq" \ |
| 65 | org.label-schema.description="Provides fabric switch discovery and provisioning" \ |
| 66 | org.label-schema.vcs-url="https://gerrit.opencord.org/maas" \ |
| 67 | org.label-schema.vendor="Open Networking Labratory" \ |
| 68 | org.label-schema.schema-version="1.0" |
| 69 | |
David K. Bainbridge | f694f5a | 2016-06-10 16:21:27 -0700 | [diff] [blame] | 70 | ENTRYPOINT ["/go/bin/switchq"] |