images
Create Lightweight Docker Images With Multi Staged Build
· ☕ 4 min read
Me Before 1 2 3 4 5 6 7 8 9 10 11 12 FROMgolang:alpineWORKDIR/go/src/github.com/santosh/qagineCOPY . .RUN go get -dRUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o app .EXPOSE8080CMD ["./app"] Me building the image. $ docker build -t sntshk/qagine . Sending build context to Docker daemon 259.6kB Step 1/7 : FROM golang:alpine ---> 760fdda71c8f Step 2/7 : WORKDIR /go/src/github.com/santosh/qagine ---> Running in e2cf75dd1655 Removing intermediate container e2cf75dd1655 ---> 8b4955b2e885 Step 3/7 : COPY .