FROM golang:1.12 as builder ARG MODE=bot ARG PROXY= WORKDIR /usr/src COPY go.mod go.mod COPY go.sum go.sum RUN GOPROXY=${PROXY} go mod download COPY . . RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o transport ./${MODE} FROM alpine:latest RUN apk update && apk add --no-cache --virtual ca-certificates WORKDIR /usr/app COPY --from=builder /usr/src/transport . CMD ["./transport"]