I’m using Docker on Windows via WSL (Windows Subsystem for Linux). When I was using Docker Desktop directly, setting up the proxy worked fine for both docker run and docker build commands. However, when using Docker through WSL with an Ubuntu environment, the proxy settings don’t seem to be applied during the docker build process.
I’m using Docker on Windows through WSL (Windows Subsystem for Linux). I’ve configured proxy settings in several places:
- Set environment variables for proxy in /etc/environment
- Configured proxy settings in /etc/docker/daemon.json
- Added proxy settings in /etc/systemd/system/docker.service.d/proxy.conf
The proxy works correctly with apt and docker pull commands within WSL. However, when I run docker build, the apt commands inside the Dockerfile do not use the proxy settings.
I need to ensure that the proxy settings applied in Docker Desktop are also used during the docker build process within WSL.
How can I ensure that Docker build commands properly use the configured proxy settings?