Is there some way to connect to a container, running inside WSL 2, using the keyword localhost instead of 127.0.0.1:port?
To give more context, I have a Docker Compose to run a Microsoft SQL Server instance configured like this:
services:
sql-server:
image: mcr.microsoft.com/mssql/server:2022-latest
user: root
ports:
- "1433:1433"
environment:
ACCEPT_EULA: "Y"
MSSQL_SA_PASSWORD: "redacted"
volumes:
- sql-server-volume:/var/opt/mssql/data
volumes:
sql-server-volume:
It is very simple and works like a charm except that I need to connect via 127.0.0.1 instead of localhost. It is like this for application, Microsoft SQL Server Management Studio and others.
Is there some way to access containers running inside WSL using localhost instead of 127.0.0.1?