From 8c595faa27282ea5505ad0cb7005ccaa292333e6 Mon Sep 17 00:00:00 2001 From: Matt Burchett Date: Thu, 4 Feb 2021 01:38:07 -0600 Subject: [PATCH] Moving Dockerfile, multistage build --- Dockerfile | 9 +++++++++ deploy/Dockerfile | 6 ------ 2 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 Dockerfile delete mode 100644 deploy/Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..094a019 --- /dev/null +++ b/Dockerfile @@ -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"] \ No newline at end of file diff --git a/deploy/Dockerfile b/deploy/Dockerfile deleted file mode 100644 index a9b83d8..0000000 --- a/deploy/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM golang:alpine - -RUN go build -o /root/matrix-handler cmd/svr/main.go - -WORKDIR /root/ -CMD ["./matrix-handler"]