New build system

Far more idiomatic.
This commit is contained in:
Matt Palmer 2017-10-27 09:51:01 +11:00
parent 2d8643d593
commit 8dcded8013
2 changed files with 20 additions and 0 deletions

16
Dockerfile Normal file
View File

@ -0,0 +1,16 @@
FROM alpine:3.5
COPY docker/start.sh /bin/start.sh
CMD ["/bin/start.sh"]
COPY main.go /go/src/github.com/discourse/discourse-auth-proxy/
RUN apk add --no-cache -t build-deps build-base git go mercurial \
&& export GOPATH=/go \
&& cd /go/src/github.com/discourse/discourse-auth-proxy \
&& go get \
&& go build -o /bin/discourse-auth-proxy \
&& apk del --purge build-deps \
# Don't ask me why, but purging the go package leaves behind about
# 8MB of cruft in /usr/lib/go which we have to nuke by hand
&& rm -rf /go /usr/lib/go

4
build Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
docker build --build-arg=http_proxy=$http_proxy -t discourse/auth-proxy .
docker push discourse/auth-proxy