Skip to content

[Bug] v1.20.3 breaks standalone WSL authentication due to false Docker Desktop proxy detection #223

@Younes-Nait-Bakkou

Description

@Younes-Nait-Bakkou

Issue Title:

[Bug] v1.20.3 breaks standalone WSL authentication due to false Docker Desktop proxy detection

Description:

In version 1.20.3, running docker scout commands on a pure WSL2 Linux environment (without Docker Desktop installed on the Windows host) results in an infinite login loop.

Even with a valid Personal Access Token (PAT) correctly stored in ~/.docker/config.json, Scout fails to authenticate. Downgrading to v1.20.2 completely resolves the issue.

Environment:

  • OS: Windows 10 with WSL2 (Ubuntu 24.04 LTS)
  • Docker Engine: v29.1.3 (Standalone Linux Engine, NO Docker Desktop installed)
  • Scout CLI: v1.20.3

Steps to Reproduce:

  1. Run pure Docker Engine in WSL2 (no Docker Desktop).
  2. Authenticate using a valid PAT: docker login docker.io -u <username>
  3. Attempt to run a scan: docker scout quickview nginx:latest
  4. Scout ignores the valid token in config.json and prompts the user to log in.

Debug Output (docker scout --debug quickview nginx:latest):

DEBUG Docker Desktop is running, using Desktop HTTP proxy transport
DEBUG failed to check for new version: failed to fetch latest version: Get "[https://api.github.com/repos/docker/scout-cli/releases/latest](https://api.github.com/repos/docker/scout-cli/releases/latest)": Moved Permanently
DEBUG could not authenticate: Post "[https://hub.docker.com/v2/auth/token](https://hub.docker.com/v2/auth/token)": POST [https://hub.docker.com/v2/auth/token](https://hub.docker.com/v2/auth/token) giving up after 1 attempt(s): Post "[https://hub.docker.com/v2/auth/token](https://hub.docker.com/v2/auth/token)": Moved Permanently
Log in with your Docker ID or email address to use docker scout.

Suspected Cause:

The debug logs explicitly show Scout stating Docker Desktop is running, using Desktop HTTP proxy transport. Because it incorrectly assumes Docker Desktop is present in the WSL environment, it attempts to route the Docker Hub authentication through a local proxy that does not exist, resulting in a 301 Moved Permanently drop.

This appears to be a regression caused by the recent PR: Use Docker Desktop HTTP proxy transport when available. The detection logic for the proxy seems to be triggering false positives on standalone WSL setups.

Workaround:

Manually deleting the v1.20.3 plugin and downloading the binary for v1.20.2 restores full functionality and authenticates correctly.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions