简体   繁体   English

无法从 GitHub 下载 Go 包

[英]Unable to download Go packages from GitHub

I'm getting below error while downloading.下载时出现以下错误。

go get github.com/go-sql-driver/mysql: module github.com/go-sql-driver/mysql: Get "https://proxy.golang.org/github.com/go-sql-driver/mysql/@v/list": x509: certificate signed by unknown authority go 获取 github.com/go-sql-driver/mysql: 模块 github.com/go-sql-driver/mysql/mysql: 获取"https://go-sql-lang-driver/mysql/mysql. /@v/list": x509: 未知权威签署的证书

Go version - 1.13/1.15(tried both) OS - Ubuntu 18 Tried update ca-certificates as well Go 版本 - 1.13/1.15(都试过)操作系统 - Ubuntu 18 也试过更新 ca 证书

Can anyone help me out?谁能帮我吗?

Check first the context in which this error pops up:首先检查弹出此错误的上下文:

  • go version
  • execution environment (shell).执行环境(外壳)。

For instance, this error pops up during Docker build instance, where the Dockerfile uses an image without certificates installed, as in golang/go issue 35702 .例如,在 Docker 构建实例期间弹出此错误,其中 Dockerfile 使用未安装证书的图像,如golang/go问题 35702
Said Dockerfile would need:说 Dockerfile 需要:

RUN apk update && apk add --no-cache git ca-certificates && update-ca-certificates

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM