gpt4 book ai didi

docker - 来自守护程序的错误响应 : Get http://localhost:8185/v2/: net/http: request canceled (Client. 等待 header 时超时)

转载 作者:行者123 更新时间:2023-12-05 06:57:13 29 4
gpt4 key购买 nike

我正在运行 Ubuntu 18.04.5 虚拟机。

我开始了本地注册表。 compose文件和docker文件如下。

FROM registry

RUN apk add --no-cache apache2-utils

RUN mkdir /auth \
&& htpasswd -bnB admin admin > /auth/htpasswd

合成文件如下。

version: "3.8"

services:
basic:
build: .
image: registrywithbasicauth:dev
ports:
- 8185:5000
environment:
REGISTRY_AUTH: htpasswd
REGISTRY_AUTH_HTPASSWD_REALM: basic-realm
REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd

当我尝试按如下方式进行 docker 登录时

docker login localhost:8185 -u admin -p admin

它给出以下输出。

Error response from daemon: Get http://localhost:8185/v2/: net/http:request canceled (Client.Timeout exceeded while awaiting headers)

docker info 提供以下内容。

vagrant@m1:~$ docker info
Client:
Debug Mode: false

Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 3
Server Version: 19.03.13
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: active
NodeID: vl9dvflwc2ikdjnqkk20azwvy
Is Manager: true
ClusterID: 8me50zl43p03nnagqcf5p77sz
Managers: 1
Nodes: 1
Default Address Pool: 10.0.0.0/8
SubnetSize: 24
Data Path Port: 4789
Orchestration:
Task History Retention Limit: 5
Raft:
Snapshot Interval: 10000
Number of Old Snapshots to Retain: 0
Heartbeat Tick: 1
Election Tick: 10
Dispatcher:
Heartbeat Period: 5 seconds
CA Configuration:
Expiry Duration: 3 months
Force Rotate: 0
Autolock Managers: false
Root Rotation In Progress: false
Node Address: 192.168.99.201
Manager Addresses:
192.168.99.201:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 8fba4e9a7d01810a393d5d25a3621dc101981175
runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
init version: fec3683
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.15.0-112-generic
Operating System: Ubuntu 18.04.5 LTS
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 985.1MiB
Name: m1
ID: G2DN:AW43:FLHA:OKHO:G25Q:CFEQ:UBNA:7FZH:UCF4:HUXZ:NMWF:UTEF
Docker Root Dir: /var/lib/docker
Debug Mode: true
File Descriptors: 40
Goroutines: 155
System Time: 2020-11-21T11:33:50.163810311Z
EventsListeners: 0
HTTP Proxy: http://proxy.example.com:80
HTTPS Proxy: https://proxy.example.com:443
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

WARNING: API is accessible on http://0.0.0.0:2375 without encryption.
Access to the remote API is equivalent to root access on the host. Refer
to the 'Docker daemon attack surface' section in the documentation for
more information: https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface
WARNING: No swap limit support

我不确定发生了什么。

看了很多引用资料,至今都无法登录成功。

部分引用资料如下。

  1. https://github.com/docker/distribution/issues/3077
  2. https://www.softwaretestinghelp.com/docker-tutorial/
  3. https://docs.docker.com/config/daemon/systemd/#httphttps-proxy

如有任何帮助,我们将不胜感激。

最佳答案

将 DNS 更改为 Google DNS 服务器。

将文件 /cat/resolv.conf 中的名称服务器更改为 8.8.8.8

nameserver 8.8.8.8

关于docker - 来自守护程序的错误响应 : Get http://localhost:8185/v2/: net/http: request canceled (Client. 等待 header 时超时),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64941815/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com