浏览代码

feat: update docker alpine package mirror (#1924)

* feat: update docker alpine package mirror

* chore: format code
Kevin Wan 2 年之前
父节点
当前提交
72ebbb9774
共有 3 个文件被更改,包括 5 次插入2 次删除
  1. 2 1
      core/stores/sqlc/cachedsql.go
  2. 2 1
      core/stringx/strings.go
  3. 1 0
      tools/goctl/docker/docker.tpl

+ 2 - 1
core/stores/sqlc/cachedsql.go

@@ -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

+ 2 - 1
core/stringx/strings.go

@@ -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)

+ 1 - 0
tools/goctl/docker/docker.tpl

@@ -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}}