From 6013d28c46d609e9c88ce50eb041c052342a5ce6 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Thu, 1 Feb 2018 08:48:59 -0800 Subject: [PATCH] Build compy in Dockerfile --- Dockerfile | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index fe5fd36..12e42bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,24 @@ +FROM ubuntu:16.04 as compy-builder +MAINTAINER Barna Csorogi + +RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y \ + curl \ + g++ \ + git \ + libjpeg8-dev + +RUN mkdir -p /usr/local/ && \ + curl -O https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz && \ + tar xf go1.9.linux-amd64.tar.gz -C /usr/local + +RUN mkdir -p /go/src/github.com/barnacs/compy/ +COPY . /go/src/github.com/barnacs/compy/ +WORKDIR /go/src/github.com/barnacs/compy +RUN /usr/local/go/bin/go get -d -v ./... +RUN /usr/local/go/bin/go build -v + FROM ubuntu:16.04 MAINTAINER Barna Csorogi @@ -12,8 +33,9 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ WORKDIR /opt/compy COPY \ - compy \ - docker.sh \ + --from=compy-builder \ + /go/src/github.com/barnacs/compy/compy \ + /go/src/github.com/barnacs/compy/docker.sh \ /opt/compy/ # TODO: configure HTTP BASIC authentication