for-win icon indicating copy to clipboard operation
for-win copied to clipboard

docker login can't connect to private registry designated in hosts file

Open guyelight opened this issue 3 years ago • 5 comments

Docker login fails after updating to 4.18 when using Windows containers. Linux on WSL2 works with 4.18.0 works as well as 4.17.1 Windows and Linux containers works without issue. While attempting to login to a private insecure registry setup on our network that requires an entry in the Windows hosts file we get a TCP lookup error.

Command:

docker login docker.artifactory.cleverdevices.com
Authenticating with existing credentials...
Login did not succeed, error: Error response from daemon: Get "http://docker.artifactory.cleverdevices.com/v2/": dial tcp: lookup docker.artifactory.cleverdevices.com on 192.168.15.5:53: no such host
Username (xxxxxx):

hosts file:

172.17.0.50 docker.artifactory.cleverdevices.com
  • [x] I have tried with the latest version of Docker Desktop
  • [x] I have tried disabling enabled experimental features
  • [x] I have uploaded Diagnostics
  • Diagnostics ID:

Actual behavior

Docker login can't find host defined in hosts file, it relies only on dns server.

Expected behavior

Docker login succeeds logging into docker registry defined in hosts file.

Information

  • Windows Version: Windows 10 Enterprise 21H2
  • Docker Desktop Version: 4.18.0
  • Windows containers (Note: Linux on WSL2 works)

Output of & "C:\Program Files\Docker\Docker\resources\com.docker.diagnose.exe" check

[2023-04-11T14:54:03.775726300Z][com.docker.diagnose.exe][I] set path configuration to OnHost Starting diagnostics

[PASS] DD0027: is there available disk space on the host? [SKIP] DD0028: is there available VM disk space? [PASS] DD0002: does the bootloader have virtualization enabled? [SKIP] DD0018: does the host support virtualization? [PASS] DD0001: is the application running? [PASS] DD0017: can a VM be started? [PASS] DD0016: is the LinuxKit VM running? [FAIL] DD0011: are the LinuxKit services running? failed to ping VM diagnosticsd with error: Get "http://ipc/ping": open \.\pipe\dockerDiagnosticd: The system cannot find the file specified. [2023-04-11T14:54:04.154536900Z][com.docker.diagnose.exe][I] ipc.NewClient: 18926637-diagnose -> \.\pipe\dockerDiagnosticd diagnosticsd [2023-04-11T14:54:04.154536900Z][com.docker.diagnose.exe][I] (fe3c4a75) 18926637-diagnose C->S diagnosticsd GET /ping [2023-04-11T14:54:04.155080200Z][com.docker.diagnose.exe][W] (fe3c4a75) 18926637-diagnose C<-S NoResponse GET /ping (543.3µs): Get "http://ipc/ping": open \.\pipe\dockerDiagnosticd: The system cannot find the file specified.

[PASS] DD0023: is the Containers Windows Feature enabled? [FAIL] DD0004: is the Docker engine running? Get "http://ipc/docker": open \.\pipe\dockerLifecycleServer: The system cannot find the file specified. [2023-04-11T14:54:04.867562000Z][com.docker.diagnose.exe][I] ipc.NewClient: e00edd23-com.docker.diagnose -> \.\pipe\dockerLifecycleServer VMDockerdAPI [2023-04-11T14:54:04.867562000Z][com.docker.diagnose.exe][I] (3d6eae9c) e00edd23-com.docker.diagnose C->S VMDockerdAPI GET /docker [2023-04-11T14:54:04.868649600Z][com.docker.diagnose.exe][W] (3d6eae9c) e00edd23-com.docker.diagnose C<-S NoResponse GET /docker (1.0876ms): Get "http://ipc/docker": open \.\pipe\dockerLifecycleServer: The system cannot find the file specified. [2023-04-11T14:54:04.869213800Z][com.docker.diagnose.exe][I] (3d6eae9c-1) e00edd23-com.docker.diagnose C->S VMDockerdAPI GET /ping [2023-04-11T14:54:04.869213800Z][com.docker.diagnose.exe][W] (3d6eae9c-1) e00edd23-com.docker.diagnose C<-S NoResponse GET /ping (0s): Get "http://ipc/ping": open \.\pipe\dockerLifecycleServer: The system cannot find the file specified. [2023-04-11T14:54:05.879935500Z][com.docker.diagnose.exe][I] (3d6eae9c-2) e00edd23-com.docker.diagnose C->S VMDockerdAPI GET /ping [2023-04-11T14:54:05.882169700Z][com.docker.diagnose.exe][W] (3d6eae9c-2) e00edd23-com.docker.diagnose C<-S NoResponse GET /ping (2.2342ms): Get "http://ipc/ping": open \.\pipe\dockerLifecycleServer: The system cannot find the file specified. [2023-04-11T14:54:06.885591400Z][com.docker.diagnose.exe][I] (3d6eae9c-3) e00edd23-com.docker.diagnose C->S VMDockerdAPI GET /ping [2023-04-11T14:54:06.886683200Z][com.docker.diagnose.exe][W] (3d6eae9c-3) e00edd23-com.docker.diagnose C<-S NoResponse GET /ping (1.0918ms): Get "http://ipc/ping": open \.\pipe\dockerLifecycleServer: The system cannot find the file specified. [2023-04-11T14:54:07.900859200Z][com.docker.diagnose.exe][I] (3d6eae9c-4) e00edd23-com.docker.diagnose C->S VMDockerdAPI GET /ping [2023-04-11T14:54:07.903995000Z][com.docker.diagnose.exe][W] (3d6eae9c-4) e00edd23-com.docker.diagnose C<-S NoResponse GET /ping (3.0206ms): Get "http://ipc/ping": open \.\pipe\dockerLifecycleServer: The system cannot find the file specified. [2023-04-11T14:54:08.921346100Z][com.docker.diagnose.exe][I] (3d6eae9c-5) e00edd23-com.docker.diagnose C->S VMDockerdAPI GET /ping [2023-04-11T14:54:08.921882300Z][com.docker.diagnose.exe][W] (3d6eae9c-5) e00edd23-com.docker.diagnose C<-S NoResponse GET /ping (0s): Get "http://ipc/ping": open \.\pipe\dockerLifecycleServer: The system cannot find the file specified. [2023-04-11T14:54:09.922069300Z][com.docker.diagnose.exe][I] (3d6eae9c-6) e00edd23-com.docker.diagnose C->S VMDockerdAPI GET /ping [2023-04-11T14:54:09.922185700Z][com.docker.diagnose.exe][W] (3d6eae9c-6) e00edd23-com.docker.diagnose C<-S NoResponse GET /ping (116.4µs): Get "http://ipc/ping": open \.\pipe\dockerLifecycleServer: The system cannot find the file specified. [2023-04-11T14:54:10.924435500Z][com.docker.diagnose.exe][I] (3d6eae9c-7) e00edd23-com.docker.diagnose C->S VMDockerdAPI GET /ping [2023-04-11T14:54:10.924589500Z][com.docker.diagnose.exe][W] (3d6eae9c-7) e00edd23-com.docker.diagnose C<-S NoResponse GET /ping (154µs): Get "http://ipc/ping": open \.\pipe\dockerLifecycleServer: The system cannot find the file specified. [2023-04-11T14:54:11.927872500Z][com.docker.diagnose.exe][I] (3d6eae9c-8) e00edd23-com.docker.diagnose C->S VMDockerdAPI GET /ping [2023-04-11T14:54:11.928020100Z][com.docker.diagnose.exe][W] (3d6eae9c-8) e00edd23-com.docker.diagnose C<-S NoResponse GET /ping (147.6µs): Get "http://ipc/ping": open \.\pipe\dockerLifecycleServer: The system cannot find the file specified.

[PASS] DD0015: are the binary symlinks installed? [FAIL] DD0031: does the Docker API work? error during connect: This error may indicate that the docker daemon is not running.: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine_linux/v1.24/containers/json?limit=0": open //./pipe/docker_engine_linux: The system cannot find the file specified. [PASS] DD0013: is the $PATH ok? [PASS] DD0003: is the Docker CLI working? [PASS] DD0005: is the user in the docker-users group? [PASS] DD0038: is the connection to Docker working? 2023/04/11 10:54:13 error checking if default wsl distro is running: exit status 0xffffffff

Steps to reproduce the behavior

  1. Setup a private repo that requires hosts file entry to access.
  2. Docker login

guyelight avatar Apr 11 '23 15:04 guyelight

Docker push fails as well if we update from 4.17.1 after updating to 4.18.0:

docker push docker.artifactory.cleverdevices.com/test
Using default tag: latest
The push refers to repository [docker.artifactory.cleverdevices.com/test]
Get "http://docker.artifactory.cleverdevices.com/v2/": dial tcp: lookup docker.artifactory.cleverdevices.com on 192.168.15.5:53: no such host

guyelight avatar Apr 11 '23 15:04 guyelight

It's a shame, last update killed all gpu's containers, now they killed all of them.

gustavozantut avatar Apr 12 '23 03:04 gustavozantut

Maybe the work around we have for issue #13430 will help you. Couldn't hurt to try it.

cyclump avatar Apr 25 '23 16:04 cyclump

Maybe the work around we have for issue #13430 will help you. Couldn't hurt to try it.

Thanks, this may help with Linux container, but not Windows Containers. Keep'em coming.

guyelight avatar May 04 '23 00:05 guyelight

This issue still exists in 4.19.0.

guyelight avatar May 04 '23 00:05 guyelight