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 | f0da873 | 2016-06-01 16:15:37 -0700 | [diff] [blame] | 14 | FROM ubuntu:14.04 |
Murat Parlakisik | 7d3bdd9 | 2016-08-08 15:36:13 -0700 | [diff] [blame^] | 15 | MAINTAINER Open Networking Laboratory <info@onlab.us> |
David K. Bainbridge | f0da873 | 2016-06-01 16:15:37 -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 |
David K. Bainbridge | 97ee805 | 2016-06-14 00:52:07 -0700 | [diff] [blame] | 41 | WORKDIR /go |
David K. Bainbridge | f0da873 | 2016-06-01 16:15:37 -0700 | [diff] [blame] | 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 | |
David K. Bainbridge | 8352c59 | 2016-06-02 12:48:37 -0700 | [diff] [blame] | 49 | RUN mkdir -p /root/.ssh |
| 50 | COPY ssh-config /root/.ssh/config |
| 51 | |
David K. Bainbridge | f0da873 | 2016-06-01 16:15:37 -0700 | [diff] [blame] | 52 | RUN go get github.com/tools/godep |
David K. Bainbridge | 97ee805 | 2016-06-14 00:52:07 -0700 | [diff] [blame] | 53 | ADD . /go/src/gerrit.opencord.org/maas/cord-provisioner |
David K. Bainbridge | f0da873 | 2016-06-01 16:15:37 -0700 | [diff] [blame] | 54 | |
David K. Bainbridge | 97ee805 | 2016-06-14 00:52:07 -0700 | [diff] [blame] | 55 | WORKDIR /go/src/gerrit.opencord.org/maas/cord-provisioner |
David K. Bainbridge | a9c2e0a | 2016-07-01 18:33:50 -0700 | [diff] [blame] | 56 | RUN $GOPATH/bin/godep restore || true |
David K. Bainbridge | f0da873 | 2016-06-01 16:15:37 -0700 | [diff] [blame] | 57 | |
| 58 | WORKDIR $GOPATH |
David K. Bainbridge | 97ee805 | 2016-06-14 00:52:07 -0700 | [diff] [blame] | 59 | RUN go install gerrit.opencord.org/maas/cord-provisioner |
David K. Bainbridge | f0da873 | 2016-06-01 16:15:37 -0700 | [diff] [blame] | 60 | |
David K. Bainbridge | d86d96d | 2016-06-01 17:28:46 -0700 | [diff] [blame] | 61 | ENTRYPOINT ["/go/bin/cord-provisioner"] |