From 0b9a8e4ca198c9c8b269c629cf9b154bec49c1bf Mon Sep 17 00:00:00 2001 From: itzaname Date: Sun, 5 Mar 2023 22:01:17 -0500 Subject: [PATCH] Multi stage docker build --- Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4160576..be27abb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,9 @@ -FROM alpine:3 -COPY rbxcompiler / +FROM registry.itzana.me/docker-proxy/library/golang:1.20 AS builder +WORKDIR /go/src/git.itzana.me/itzaname/rbxcompiler +COPY . ./ +RUN CGO_ENABLED=0 go build -a -installsuffix cgo -o /rbxcompiler ./cmd/rbxcompiler + +FROM registry.itzana.me/docker-proxy/library/alpine:3 +COPY --from=builder /rbxcompiler / WORKDIR /stage ENTRYPOINT ["/rbxcompiler"] \ No newline at end of file