From 8b20db86f3d5da60ace214423a6746936ce1314c Mon Sep 17 00:00:00 2001 From: Max Resnick Date: Fri, 29 May 2020 23:05:54 -0700 Subject: more reasonable builds --- Dockerfile | 15 +++++++++------ Makefile | 6 ++++++ go.mod | 2 ++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 131220f..0f8be2f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,15 @@ -FROM golang:1.11 +FROM golang:1.11 as build -EXPOSE 8080 -RUN \ - curl -fsSLO https://get.docker.com/builds/Linux/x86_64/docker-latest.tgz && \ - tar --strip-components=1 -xvzf docker-latest.tgz -C /usr/local/bin ENV GO111MODULE=on RUN mkdir -p /go/src/go.uber.org/sally WORKDIR /go/src/go.uber.org/sally ADD . /go/src/go.uber.org/sally/ RUN go mod vendor -CMD ["make", "run"] +RUN make grumps-build && ls -la /go/src/go.uber.org/sally/_tmp/sally + +FROM scratch + +EXPOSE 8080 +COPY sally.yaml / +COPY --from=build /go/src/go.uber.org/sally/_tmp/sally /sally +ENTRYPOINT ["/sally"] diff --git a/Makefile b/Makefile index efa0d0a..b678617 100644 --- a/Makefile +++ b/Makefile @@ -72,3 +72,9 @@ docker-launch: docker-build .PHONY: install run: install sally + +.PHONY: grumps-build +grumps-build: test + rm -rf _tmp + mkdir -p _tmp + CGO_ENABLED=0 go build -a -o _tmp/sally . diff --git a/go.mod b/go.mod index 06701c8..9ae48f2 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,7 @@ module go.uber.org/sally +go 1.14 + require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-bindata/go-bindata v1.0.0 -- cgit v1.2.3