FROM golang:alpine AS build WORKDIR /go/src/github.com/yumc.pw/cloud ADD main.go . RUN go build FROM alpine:edge LABEL maintainer="MiaoWoo" ENV LANG C.UTF-8 WORKDIR /root RUN apk add --no-cache ca-certificates COPY --from=build /go/src/github.com/yumc.pw/cloud/cloud ./main ENV SOURCE=yumc.pw ENV TARGET=https://git.yumc.pw ENV PROTOCOL=git CMD ./main -s ${SOURCE} -t ${TARGET} -p ${PROTOCOL}