You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
516 B

4 years ago
4 years ago
4 years ago
  1. FROM golang:alpine as builder
  2. # 设置go mod proxy 国内代理
  3. # 设置golang path
  4. ENV GOPROXY=https://goproxy.cn,https://goproxy.io,direct \
  5. GO111MODULE=on \
  6. CGO_ENABLED=1
  7. WORKDIR /ginvue
  8. RUN go env -w GOPROXY=https://goproxy.cn,https://goproxy.io,direct
  9. COPY . .
  10. RUN go env && go list && go build -o app main.go
  11. EXPOSE 8888
  12. ENTRYPOINT /ginvue/app
  13. # 根据Dockerfile生成Docker镜像
  14. # docker build -t ginvue .
  15. # 根据Docker镜像启动Docker容器
  16. # docker run -itd -p 8888:8888 --name ginvue ginvue