...
Check jq version, it should be like jq-1.6
Code Block |
---|
jq --version |
Expose Docker to Windows shell and Idea
To expose the Docker command a simple executable file can be added to Windows $PATH
:
Code Block | ||
---|---|---|
| ||
@echo off
wsl -e docker %* |
To expose Docker's TCP port securely, you can use an SSH tunnel from Windows to WSL.
Install SSH Server in WSL:
Update your packages and install OpenSSH:
Code Block sudo apt update sudo apt install openssh-server
Ensure SSH is running:
Code Block sudo service ssh start
Configure SSH (if necessary):
You might want to configure SSH to start automatically or adjust settings, but default settings are usually sufficient for local development.
Create an SSH Tunnel from Windows:
Open a command prompt or PowerShell in Windows.
Create an SSH tunnel mapping the Docker socket:
Code Block ssh -L localhost:2375:/var/run/docker.sock your_wsl_username@localhost
This command forwards the local port
2375
to the Docker socket in WSL. Replaceyour_wsl_username
with your actual WSL username.
Set
DOCKER_HOST
in Windows:Set the
DOCKER_HOST
environment variable to use the local forwarded port (in PowerShell or using Edit the System environment variables in Control Panel):
Code Block DOCKER_HOST = "tcp://localhost:2375"
Linux
Will be added
MacOS
Will be added
...