Multi stage docker build

This commit is contained in:
itzaname 2023-03-05 22:01:17 -05:00
parent 1758cfea65
commit 0b9a8e4ca1

View File

@ -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"]