解决docer login报错 panic: runtime error: invalid memory address or nil pointer dereference

问题描述

不知道自己做了什么操作,然后进行docker login的时候,突然出现以下错误

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x561d24c09d76]

goroutine 1 [running]:
github.com/docker/cli/cli/command.ConfigureAuth(0x561d2684ace0, 0xc0003d4820, 0x0, 0x0, 0x0, 0x0, 0x0, 0x561d267ba101, 0xc0005ed1a0, 0xc00059b968)
	/go/src/github.com/docker/cli/cli/command/registry.go:128 +0x46
github.com/docker/cli/cli/command/registry.runLogin(0x561d2684ace0, 0xc0003d4820, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/go/src/github.com/docker/cli/cli/command/registry/login.go:123 +0x223
github.com/docker/cli/cli/command/registry.NewLoginCommand.func1(0xc000384840, 0x561d27855448, 0x0, 0x0, 0x0, 0x0)
	/go/src/github.com/docker/cli/cli/command/registry/login.go:45 +0xcc
github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).execute(0xc000384840, 0xc0005ec2f0, 0x0, 0x0, 0xc000384840, 0xc0005ec2f0)
	/go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:850 +0x462
github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc0002782c0, 0xc0005ec2f0, 0x1, 0x1)
	/go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:958 +0x34b
github.com/docker/cli/vendor/github.com/spf13/cobra.(*Command).Execute(...)
	/go/src/github.com/docker/cli/vendor/github.com/spf13/cobra/command.go:895
main.runDocker(0xc0003d4820, 0x561d267bcde0, 0xc000010020)
	/go/src/github.com/docker/cli/cmd/docker/docker.go:287 +0x1d3
main.main()
	/go/src/github.com/docker/cli/cmd/docker/docker.go:298 +0xf3

环境如下

Client: Docker Engine - Community
 Version:           20.10.2
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        2291f61
 Built:             Mon Dec 28 16:17:32 2020
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.2
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       8891c58
  Built:            Mon Dec 28 16:15:09 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 nvidia:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

解决方案

dpkg -r --ignore-depends=golang-docker-credential-helpers golang-docker-credential-helpers

如果以下提示,使用sudo即可

dpkg: error: requested operation requires superuser privilege

参考链接

https://github.com/docker/cli/issues/2890
https://github.com/docker/compose/issues/6023

猜你喜欢

转载自blog.csdn.net/qq_39544148/article/details/128563486