"WSL Proxy Issue Affecting compiler.p​ackage.mic​roserviceD​ockerImage in MATLAB?"

8 views (last 30 days)
Hi all,
I am running MATLAB R2024b on Windows 11 with WSL 2 installed.
I successfully created a .ctf library using compiler.build.productionServerArchive, and I am now trying to prepare a Docker image using compiler.package.microserviceDockerImage.
However, when I run this command, I encounter the following error related to a proxy issue:
---------------------------------------------------------------------------------
Error using compiler.internal.package.docker.Proxy/assertDockerIsAvailable (line 80)
In order to use 'compiler.package.microserviceDockerImage' you must be able to run in MATLAB:
system('docker version')
or
system('wsl docker version')
and it should return zero.
Error in compiler.package.microserviceDockerImage (line 158)
proxy.assertDockerIsAvailable('compiler.package.microserviceDockerImage');
-----------------------------------------------------------------------------------
I have manually executed system('wsl docker version') within MATLAB, and it correctly returns 0, indicating that Docker should be available.
However, I suspect that the issue is related to a warning message that appears every time I start WSL from powershell:
wsl: A localhost proxy configuration was detected but not mirrored into WSL. WSL in NAT mode does not support localhost proxies.
Additionally, when running system('wsl docker version') in MATLAB, I notice an unexpected "w" character appearing before the expected output, such as:
> wClient: Docker Engine - Community
Does this suggests that MATLAB might be interpreting part of the warning as part of the actual command output and this causing issues with Docker detection?
Could you provide any guidance on how to resolve this issue?
Thank you for your time and assistance.
Best Regards,
Andrea

Answers (1)

Jacob Mathew
Jacob Mathew on 9 Jun 2025
Hey Andrea,
There seems to be an official ticket raised in Microsoft's WSL GItHub Repository related to allowing Windows Firewall access to WSL2 which seems to encompass the issue of localhost proxy not working. It require you to setup an additional rule to request access for the app the first time it tries to access the network. You can find the workaround in the official issue ticket link below:
I would suggest ensuring that both WSL 2 and Docker are both upto date before trying this as there is a chance that this fix might be part of an update as the ticket dates back to 2019.

Categories

Find more on MATLAB Mobile in Help Center and File Exchange

Products


Release

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!