Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
languagebash
@echo off
wsl -e docker %*

To expose Docker's TCP port securely, you can use an SSH tunnel from Windows to WSL.

  1. Install SSH Server in WSL:

    • Update your packages and install OpenSSH:

    Code Block
    sudo apt update
    sudo apt install openssh-server
  2. Ensure SSH is running:

    Code Block
    sudo service ssh start
  3. 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.

  4. 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. Replace your_wsl_username with your actual WSL username.

  5. 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

...