blob: 6d75afb453559bdf5e8259c89781652f03a4120b [file] [log] [blame]
David K. Bainbridgedf9df632016-07-07 18:47:46 -07001## 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. Bainbridgef0da8732016-06-01 16:15:37 -070014FROM ubuntu:14.04
Murat Parlakisik7d3bdd92016-08-08 15:36:13 -070015MAINTAINER Open Networking Laboratory <info@onlab.us>
David K. Bainbridgef0da8732016-06-01 16:15:37 -070016
17# Base image information borrowed by official golang wheezy Dockerfile
18RUN 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
26ENV GOLANG_VERSION 1.6.2
27ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
28ENV GOLANG_DOWNLOAD_SHA256 e40c36ae71756198478624ed1bb4ce17597b3c19d243f3f0899bb5740d56212a
29
30RUN 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
35ENV GOPATH /go
36ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
37
38RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
39
40# CORD Provisioner Dockerfile
David K. Bainbridge97ee8052016-06-14 00:52:07 -070041WORKDIR /go
David K. Bainbridgef0da8732016-06-01 16:15:37 -070042
43RUN 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. Bainbridge8352c592016-06-02 12:48:37 -070049RUN mkdir -p /root/.ssh
50COPY ssh-config /root/.ssh/config
51
David K. Bainbridgef0da8732016-06-01 16:15:37 -070052RUN go get github.com/tools/godep
David K. Bainbridge97ee8052016-06-14 00:52:07 -070053ADD . /go/src/gerrit.opencord.org/maas/cord-provisioner
David K. Bainbridgef0da8732016-06-01 16:15:37 -070054
David K. Bainbridge97ee8052016-06-14 00:52:07 -070055WORKDIR /go/src/gerrit.opencord.org/maas/cord-provisioner
David K. Bainbridgea9c2e0a2016-07-01 18:33:50 -070056RUN $GOPATH/bin/godep restore || true
David K. Bainbridgef0da8732016-06-01 16:15:37 -070057
58WORKDIR $GOPATH
David K. Bainbridge97ee8052016-06-14 00:52:07 -070059RUN go install gerrit.opencord.org/maas/cord-provisioner
David K. Bainbridgef0da8732016-06-01 16:15:37 -070060
David K. Bainbridged86d96d2016-06-01 17:28:46 -070061ENTRYPOINT ["/go/bin/cord-provisioner"]