Convert build.sh to a multi-stage Dockerfile. (#452)

This commit is contained in:
Justin
2018-01-28 11:49:31 +08:00
committed by Ta-Ching Chen
parent 4f7eb19b7c
commit 986b300b8c
6 changed files with 59 additions and 16 deletions
+11 -3
View File
@@ -1,10 +1,18 @@
FROM golang:onbuild
WORKDIR /go
COPY *.go /go/
RUN GOOS=linux GOARCH=386 go build -o server .
FROM alpine:3.5
WORKDIR /app
RUN apk update
RUN apk add coreutils binutils findutils grep
COPY . /app
WORKDIR /app
COPY --from=0 /go/server /app/server
EXPOSE 8888
ENTRYPOINT ["./server"]
ENTRYPOINT ["./server"]