Moving Dockerfile, multistage build

This commit is contained in:
Matt Burchett 2021-02-04 01:38:07 -06:00
parent 128ee5d5a7
commit 8c595faa27
2 changed files with 9 additions and 6 deletions

9
Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM golang:alpine AS build
WORKDIR /root/
COPY * /root/
RUN go build -o /root/matrix-handler cmd/svr/main.go
FROM scratch
COPY --from=build /root/matrix-handler /bin/matrix-handler
ENTRYPOINT ["/bin/matrix-handler"]

View File

@ -1,6 +0,0 @@
FROM golang:alpine
RUN go build -o /root/matrix-handler cmd/svr/main.go
WORKDIR /root/
CMD ["./matrix-handler"]