作者 yangfu

base image

  1 +FROM golang:1.19-alpine as builder
  2 +
  3 +# Define the project name | 定义项目名称
  4 +ARG PROJECT=core
  5 +
  6 +WORKDIR /build
  7 +COPY . .
  8 +
  9 +RUN go env -w GO111MODULE=on \
  10 + && go env -w GOPROXY=https://goproxy.cn,direct \
  11 + && go env -w CGO_ENABLED=0 \
  12 + && go env \
  13 + && go mod tidy \
  14 + && cd cmd/chart-server/api \
  15 + && go build -ldflags="-s -w" -o /build/api/${PROJECT} ${PROJECT}.go
@@ -20,4 +20,13 @@ goctl api plugin -plugin goctl-swagger="swagger -filename core.json" -api .\doc\ @@ -20,4 +20,13 @@ goctl api plugin -plugin goctl-swagger="swagger -filename core.json" -api .\doc\
20 20
21 ``` 21 ```
22 docker build -f Dockerfile -t tiptok/sumifcc-bchart:1.0.0 . 22 docker build -f Dockerfile -t tiptok/sumifcc-bchart:1.0.0 .
  23 +```
  24 +
  25 +## 基础镜像
  26 +
  27 +```
  28 +docker build -f DockerfileBase -t tiptok/sumifcc-bchart-base:1.0.0 .
  29 +docker save -o sumifcc-bchart-base.tar tiptok/sumifcc-bchart-base:1.0.0
  30 +docker load --input sumifcc-bchart-base.tar
  31 +docker tag
23 ``` 32 ```