We can build our application in Dockerfile. But we don’t want the whole thing in our final docker image. Docker multi-stage technology could help us the reduce the size.
FROM golang:1.12 AS builder
RUN git clone https://github.com/devops-ws/learn-pipeline-go && \
cd learn-pipeline-go && go build -o go-server
RUN ls -hal
COPY --from=builder /work/learn-pipeline-go/go-server .