Docker multi builder

PHOTO EMBED

Tue Mar 28 2023 07:52:34 GMT+0000 (Coordinated Universal Time)

Saved by @amirabbas8643 #docker #multi-builder

FROM golang:alpine as builder

label "maintainer"="amirabbasmehvari@gmail.com"
RUN mkdir /app
WORKDIR /app/
COPY . /app/
RUN go build -o main .

FROM alpine
COPY --from=builder /app/main /app/
WORKDIR /app/
CMD ["./main"]
content_copyCOPY

for build multi image from in docker file we can write like this, this image is very smaller than from two image