feat: update docker alpine package mirror (#1924)

* feat: update docker alpine package mirror

* chore: format code
master
Kevin Wan 3 years ago committed by GitHub
parent f1fdd55b38
commit 72ebbb9774
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -97,7 +97,8 @@ func (cc CachedConn) Exec(exec ExecFn, keys ...string) (sql.Result, error) {
} }
// ExecCtx runs given exec on given keys, and returns execution result. // ExecCtx runs given exec on given keys, and returns execution result.
func (cc CachedConn) ExecCtx(ctx context.Context, exec ExecCtxFn, keys ...string) (sql.Result, error) { func (cc CachedConn) ExecCtx(ctx context.Context, exec ExecCtxFn, keys ...string) (
sql.Result, error) {
res, err := exec(ctx, cc.db) res, err := exec(ctx, cc.db)
if err != nil { if err != nil {
return nil, err return nil, err

@ -103,7 +103,8 @@ func Reverse(s string) string {
return string(runes) return string(runes)
} }
// Substr returns runes between start and stop [start, stop) regardless of the chars are ascii or utf8. // Substr returns runes between start and stop [start, stop)
// regardless of the chars are ascii or utf8.
func Substr(str string, start, stop int) (string, error) { func Substr(str string, start, stop int) (string, error) {
rs := []rune(str) rs := []rune(str)
length := len(rs) length := len(rs)

@ -4,6 +4,7 @@ LABEL stage=gobuilder
ENV CGO_ENABLED 0 ENV CGO_ENABLED 0
{{if .Chinese}}ENV GOPROXY https://goproxy.cn,direct {{if .Chinese}}ENV GOPROXY https://goproxy.cn,direct
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
{{end}}{{if .HasTimezone}} {{end}}{{if .HasTimezone}}
RUN apk update --no-cache && apk add --no-cache tzdata RUN apk update --no-cache && apk add --no-cache tzdata
{{end}} {{end}}

Loading…
Cancel
Save