Skip to content

Commit e435af3

Browse files
LJTianSea-n
andauthored
Update README-zh.md (#34974)
* Update README-zh.md Added run 'make container-image' command timeout solution * Update README-zh.md Co-authored-by: Sean <[email protected]> * Update README-zh.md Co-authored-by: Sean <[email protected]> * Update README-zh.md Co-authored-by: Sean <[email protected]> * Remove unofficial addresses Co-authored-by: Sean <[email protected]>
1 parent 9a2a9ad commit e435af3

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

README-zh.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,51 @@ This works for Catalina as well as Mojave macOS.
257257
-->
258258
这适用于 Catalina 和 Mojave macOS。
259259

260+
### 对执行 make container-image 命令部分地区访问超时的故障排除
261+
262+
现象如下:
263+
264+
```shell
265+
langs/language.go:23:2: golang.org/x/[email protected]: Get "https://proxy.golang.org/golang.org/x/text/@v/v0.3.7.zip": dial tcp 142.251.43.17:443: i/o timeout
266+
langs/language.go:24:2: golang.org/x/[email protected]: Get "https://proxy.golang.org/golang.org/x/text/@v/v0.3.7.zip": dial tcp 142.251.43.17:443: i/o timeout
267+
common/text/transform.go:21:2: golang.org/x/[email protected]: Get "https://proxy.golang.org/golang.org/x/text/@v/v0.3.7.zip": dial tcp 142.251.43.17:443: i/o timeout
268+
common/text/transform.go:22:2: golang.org/x/[email protected]: Get "https://proxy.golang.org/golang.org/x/text/@v/v0.3.7.zip": dial tcp 142.251.43.17:443: i/o timeout
269+
common/text/transform.go:23:2: golang.org/x/[email protected]: Get "https://proxy.golang.org/golang.org/x/text/@v/v0.3.7.zip": dial tcp 142.251.43.17:443: i/o timeout
270+
hugolib/integrationtest_builder.go:29:2: golang.org/x/[email protected]: Get "https://proxy.golang.org/golang.org/x/tools/@v/v0.1.11.zip": dial tcp 142.251.42.241:443: i/o timeout
271+
deploy/google.go:24:2: google.golang.org/[email protected]: Get "https://proxy.golang.org/google.golang.org/api/@v/v0.76.0.zip": dial tcp 142.251.43.17:443: i/o timeout
272+
parser/metadecoders/decoder.go:32:2: gopkg.in/[email protected]: Get "https://proxy.golang.org/gopkg.in/yaml.v2/@v/v2.4.0.zip": dial tcp 142.251.42.241:443: i/o timeout
273+
The command '/bin/sh -c mkdir $HOME/src && cd $HOME/src && curl -L https://github.com/gohugoio/hugo/archive/refs/tags/v${HUGO_VERSION}.tar.gz | tar -xz && cd "hugo-${HUGO_VERS ION}" && go install --tags extended' returned a non-zero code: 1
274+
make: *** [Makefile:69:container-image] error 1
275+
```
276+
277+
请修改 `Dockerfile` 文件,为其添加网络代理。修改内容如下:
278+
279+
```dockerfile
280+
...
281+
FROM golang:1.18-alpine
282+
283+
LABEL maintainer="Luc Perkins <[email protected]>"
284+
285+
ENV GO111MODULE=on # 需要添加内容1
286+
287+
ENV GOPROXY=https://proxy.golang.org,direct # 需要添加内容2
288+
289+
RUN apk add --no-cache \
290+
curl \
291+
gcc \
292+
g++ \
293+
musl-dev \
294+
build-base \
295+
libc6-compat
296+
297+
ARG HUGO_VERSION
298+
...
299+
```
300+
301+
将 "https://proxy.golang.org" 替换为本地可以使用的代理地址。
302+
303+
**注意:** 此部分仅适用于中国大陆
304+
260305
<!--
261306
## Get involved with SIG Docs
262307

0 commit comments

Comments
 (0)