这是我第一次尝试使用Docker镜像来实现用户身份验证的Spring Boot应用程序。
所以,我有一个Docker镜像的活动目录,从Docker https://hub.docker.com/r/clcmanagedos/active-directory-services/下载。
当我尝试运行docker镜像时,它会抛出异常。
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
clcmanagedos/active-directory-services latest c1457128bd49 3 months ago 107MB
$ docker run -i -t c1457128bd49 /bin/zsh
Traceback (most recent call last):
File "/usr/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 141, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "/usr/lib/python3.5/site-packages/requests/packages/urllib3/util/connection.py", line 60, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/usr/lib/python3.5/socket.py", line 732, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name does not resolve
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 356, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.5/http/client.py", line 1106, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python3.5/http/client.py", line 1151, in _send_request
self.endheaders(body)
File "/usr/lib/python3.5/http/client.py", line 1102, in endheaders
self._send_output(message_body)
File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
File "/usr/lib/python3.5/http/client.py", line 877, in send
self.connect()
File "/usr/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 166, in connect
conn = self._new_conn()
File "/usr/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 150, in _new_conn
self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.HTTPConnection object at 0x7f7f827fc1d0>: Failed to establish a new connection: [Errno -2] Name does not resolve
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.5/site-packages/requests/adapters.py", line 423, in send
timeout=timeout
File "/usr/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 649, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/lib/python3.5/site-packages/requests/packages/urllib3/util/retry.py", line 376, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='none', port=8500): Max retries exceeded with url: /v1/kv/config/active-directory/db-region (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f7f827fc1d0>: Failed to establish a new connection: [Errno -2] Name does not resolve',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "active_directory_services.py", line 28, in <module>
region_name=kv('db-region'),
File "active_directory_services.py", line 23, in kv
index, data = c.kv.get(consul_prefix + key, index=index)
File "/usr/lib/python3.5/site-packages/consul/base.py", line 467, in get
params=params)
File "/usr/lib/python3.5/site-packages/consul/std.py", line 35, in get
self.session.get(uri, verify=self.verify)))
File "/usr/lib/python3.5/site-packages/requests/sessions.py", line 501, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python3.5/site-packages/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3.5/site-packages/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3.5/site-packages/requests/adapters.py", line 487, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='none', port=8500): Max retries exceeded with url: /v1/kv/config/active-directory/db-region (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f7f827fc1d0>: Failed to establish a new connection: [Errno -2] Name does not resolve',))