blob: b35438d365bb5b349795547eb865d22602f5d9b1 [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. Bainbridgef694f5a2016-06-10 16:21:27 -070014FROM ubuntu:14.04
Murat Parlakisik7d3bdd92016-08-08 15:36:13 -070015MAINTAINER Open Networking Laboratory <info@onlab.us>
David K. Bainbridgef694f5a2016-06-10 16:21:27 -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
41WORKDIR $GOPATH
42
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
49RUN mkdir -p /root/.ssh
50COPY ssh-config /root/.ssh/config
51
52RUN mkdir -p /switchq
53COPY vendors.json /switchq/vendors.json
54
55RUN go get github.com/tools/godep
56ADD . $GOPATH/src/gerrit.opencord.com/maas/switchq
57
58WORKDIR $GOPATH/src/gerrit.opencord.com/maas/switchq
David K. Bainbridgea9c2e0a2016-07-01 18:33:50 -070059RUN $GOPATH/bin/godep restore || true
David K. Bainbridgef694f5a2016-06-10 16:21:27 -070060
61WORKDIR $GOPATH
62RUN go install gerrit.opencord.com/maas/switchq
63
64ENTRYPOINT ["/go/bin/switchq"]