David K. Bainbridge | efa951d | 2016-05-26 10:54:25 -0700 | [diff] [blame] | 1 | FROM ubuntu:14.04 |
| 2 | |
David K. Bainbridge | d9b966f | 2016-05-31 13:30:05 -0700 | [diff] [blame] | 3 | # Base image information borrowed by official golang wheezy Dockerfile |
| 4 | RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 5 | g++ \ |
| 6 | gcc \ |
| 7 | libc6-dev \ |
| 8 | make \ |
| 9 | curl \ |
| 10 | && rm -rf /var/lib/apt/lists/* |
David K. Bainbridge | efa951d | 2016-05-26 10:54:25 -0700 | [diff] [blame] | 11 | |
David K. Bainbridge | d9b966f | 2016-05-31 13:30:05 -0700 | [diff] [blame] | 12 | ENV GOLANG_VERSION 1.6.2 |
| 13 | ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz |
| 14 | ENV GOLANG_DOWNLOAD_SHA256 e40c36ae71756198478624ed1bb4ce17597b3c19d243f3f0899bb5740d56212a |
| 15 | |
| 16 | RUN curl -kfsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \ |
| 17 | && echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \ |
| 18 | && tar -C /usr/local -xzf golang.tar.gz \ |
| 19 | && rm golang.tar.gz |
| 20 | |
| 21 | ENV GOPATH /go |
| 22 | ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH |
| 23 | |
| 24 | RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" |
| 25 | |
| 26 | # CORD Automation Dockerfile |
| 27 | WORKDIR $GOPATH |
| 28 | |
| 29 | RUN apt-get update && \ |
| 30 | apt-get install -y software-properties-common && \ |
| 31 | apt-add-repository ppa:ansible/ansible && \ |
| 32 | apt-get update -y -m && \ |
| 33 | apt-get install -y git ansible |
| 34 | |
David K. Bainbridge | efa951d | 2016-05-26 10:54:25 -0700 | [diff] [blame] | 35 | RUN go get github.com/tools/godep |
David K. Bainbridge | 97ee805 | 2016-06-14 00:52:07 -0700 | [diff] [blame^] | 36 | ADD . $GOPATH/src/gerrit.opencord.org/maas/cord-maas-automation |
David K. Bainbridge | efa951d | 2016-05-26 10:54:25 -0700 | [diff] [blame] | 37 | |
David K. Bainbridge | 97ee805 | 2016-06-14 00:52:07 -0700 | [diff] [blame^] | 38 | WORKDIR $GOPATH/src/gerrit.opencord.org/maas/cord-maas-automation |
David K. Bainbridge | d9b966f | 2016-05-31 13:30:05 -0700 | [diff] [blame] | 39 | RUN $GOPATH/bin/godep restore |
David K. Bainbridge | efa951d | 2016-05-26 10:54:25 -0700 | [diff] [blame] | 40 | |
David K. Bainbridge | d9b966f | 2016-05-31 13:30:05 -0700 | [diff] [blame] | 41 | WORKDIR $GOPATH |
David K. Bainbridge | 97ee805 | 2016-06-14 00:52:07 -0700 | [diff] [blame^] | 42 | RUN go install gerrit.opencord.org/maas/cord-maas-automation |
David K. Bainbridge | efa951d | 2016-05-26 10:54:25 -0700 | [diff] [blame] | 43 | |
David K. Bainbridge | d9b966f | 2016-05-31 13:30:05 -0700 | [diff] [blame] | 44 | ENTRYPOINT ["$GOPATH/bin/cord-maas-automation"] |