I'm currently using Windows 11 Pro with Docker Desktop running on the WSL2 backend. However, I'm facing issues with a corporate proxy that requires authentication, specifically in the format `http://username:[email protected]:8080`. Whenever I try to pull images or log in, I encounter an error saying 'Proxy Authentication Required,' along with another message in the logs indicating that the http proxy settings must not include credentials. I've tried several solutions, like setting the manual proxy in Docker Desktop settings, using PowerShell to set environment variables, and modifying Docker's config files, but nothing seems to work since Docker strips out credentials or refuses to start. Can anyone help me figure out how to properly authenticate Docker through this proxy? Are there any secure methods for handling the credentials? Also, would using an external authentication agent work in this scenario?
2 Answers
If you're using WSL2, you might consider installing Docker directly within the WSL environment instead of using Docker Desktop. It's like having a standard Ubuntu VM. Just make sure to configure access properly so you can reach Docker from your host machine.
To handle proxy authentication with Docker, we usually set up a local proxy like Pxy that forwards requests. This way, Docker can connect to the local proxy without needing to include credentials in the configuration.
I get that, but how do I connect to the Docker daemon from Windows if it's running in WSL?