You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WSL2 just introduced a new networking mode: networkingMode=mirrored. It's awesome. Fixes a lot of problems people have with using WSL while connected to a corporate VPN. https://devblogs.microsoft.com/commandline/windows-subsystem-for-linux-september-2023-update/
However, there is something wrong with binding ports in docker when this new method is set. It makes it impossible to sam build in a container. It errors out indicating the port is already in use. There's a (IMO, dumb) workaround that gets sam build working again: microsoft/WSL#10494 (comment) However, you have to add every port, separated by commas, to the ignoredPorts config item.
This is definitely a WSL issue. However, it'd be nice if we could specify which ports sam uses with docker while building to make it easier to apply this workaround. Right now, the values are listed here:
This is definitely a WSL issue. However, it'd be nice if we could specify which ports sam uses with docker while building to make it easier to apply this workaround. Right now, the values are listed here:
The ports are chosen at random between 5000-9000 so that you could run multiple sam local invokes, start-api, start-lambda etc in parallel. There is no certain set of ports that you could allow. However when you setup debugging, there is a port number that you can pass in the arguments which could be allowlisted.
The ports are chosen at random between 5000-9000 so that you ...
While I appreciate being able to run multiple sam commands in parallel, it's those 4000 ports I'd like to be able to customize. On my personal machine, I don't ever run enough simultaneous sam commands to need 4000 ports. I'd love it if I could customize that range.
Description:
WSL2 just introduced a new networking mode:
networkingMode=mirrored
. It's awesome. Fixes a lot of problems people have with using WSL while connected to a corporate VPN. https://devblogs.microsoft.com/commandline/windows-subsystem-for-linux-september-2023-update/However, there is something wrong with binding ports in docker when this new method is set. It makes it impossible to sam build in a container. It errors out indicating the port is already in use. There's a (IMO, dumb) workaround that gets sam build working again: microsoft/WSL#10494 (comment) However, you have to add every port, separated by commas, to the
ignoredPorts
config item.This is definitely a WSL issue. However, it'd be nice if we could specify which ports sam uses with docker while building to make it easier to apply this workaround. Right now, the values are listed here:
aws-sam-cli/samcli/local/docker/container.py
Lines 124 to 125 in c5b9b1e
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: 1.97.0The text was updated successfully, but these errors were encountered: