File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -4,10 +4,12 @@ LABEL stage=gobuilder
44
55ENV CGO_ENABLED 0
66{{if .Chinese }}ENV GOPROXY https://goproxy.cn ,direct
7+
78RUN sed -i 's/dl-cdn.alpinelinux.org /mirrors.aliyun.com /g' /etc/apk/repositories
8- {{end }}{{if .HasTimezone }}
9+ {{- end }}{{if .HasTimezone }}
910RUN apk update --no-cache && apk add --no-cache tzdata
10- {{end }}
11+ {{- end }}
12+
1113WORKDIR /build
1214
1315ADD go.mod .
@@ -21,14 +23,15 @@ RUN go build -ldflags="-s -w" -o /app/{{.ExeFile}} {{.GoMainFrom}}
2123FROM {{.BaseImage }}
2224
2325COPY --from= builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
24- {{if .HasTimezone }}COPY --from= builder /usr/share/zoneinfo/{{.Timezone }} /usr/share/zoneinfo/{{.Timezone }}
26+ {{if .HasTimezone -}}
27+ COPY --from= builder /usr/share/zoneinfo/{{.Timezone }} /usr/share/zoneinfo/{{.Timezone }}
2528ENV TZ {{.Timezone }}
2629{{end }}
2730WORKDIR /app
2831COPY --from= builder /app/{{.ExeFile }} /app/{{.ExeFile }}
29- {{if .Argument }}COPY {{ .GoRelPath }}/etc /app/etc
30- {{ end }}
31-
32+ {{if .Argument -}}
33+ COPY {{ .GoRelPath }}/etc /app/etc
34+ {{- end }}
3235{{if .HasPort }}
3336EXPOSE {{.Port }}
3437{{end }}
You can’t perform that action at this time.
0 commit comments