命令
go install ./xxx/...eg : go install ./gateway/...
docker 编译
1 拉取镜像
docker pull golang
2. 镜像设置
go env -w GO111MODULE=ongo env -w GOPROXY=https://goproxy.cn,directgo install
Docker file
# 启动编译环境FROM golang:1.16# 配置编译环境go env -w GO111MODULE=ongo env -w GOPROXY=https://goproxy.cn,direct# 拷贝源码到进行中# COPY source image_pathCOPY . /go/src/car/server# 编译WORKDIR /go/src/car/serverRUN go install ./gateway/...
