xitong commited on
Commit
c2edd6b
·
1 Parent(s): fe55d2f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -4
Dockerfile CHANGED
@@ -1,17 +1,17 @@
1
  # Build stage
2
- #使用golang:alpine作为构建阶段的基础镜像
3
  FROM golang:alpine As builder
4
 
5
- #添加git,以便之后能从 GitHub克隆项目
6
  RUN apk --no-cache add git
7
 
8
- #从GitHub克隆go-proxy-UIDesignAssistant 项目到/workspace/app目录下
9
  RUN git clone https://github.com/Harry-zklcdc/go-proxy-UIDesignAssistant.git /workspace/app
10
 
11
  #设器工作目录为之前克隆的项目目录
12
  WORKDIR /workspace/app
13
 
14
- #编译go项目 -ldflags="-5 -w”是为了减少编译后的二进制大小
15
  RUN go build -ldflags="-s -w" -tags netgo -trimpath -o go-proxy-UIDesignAssistant main.go
16
 
17
  #Runtime stage
 
1
  # Build stage
2
+ #使用 golang:alpine 作为构建阶段的基础镜像
3
  FROM golang:alpine As builder
4
 
5
+ #添加 git,以便之后能从 GitHub克隆项目
6
  RUN apk --no-cache add git
7
 
8
+ #从 GitHub 克隆 go-proxy-UIDesignAssistant 项目到/workspace/app目录下
9
  RUN git clone https://github.com/Harry-zklcdc/go-proxy-UIDesignAssistant.git /workspace/app
10
 
11
  #设器工作目录为之前克隆的项目目录
12
  WORKDIR /workspace/app
13
 
14
+ #编译 go项目。 -ldflags="-5 -w”是为了减少编译后的二进制大小
15
  RUN go build -ldflags="-s -w" -tags netgo -trimpath -o go-proxy-UIDesignAssistant main.go
16
 
17
  #Runtime stage