Skip to content

Instantly share code, notes, and snippets.

@edjdavid
Last active December 3, 2023 14:50
Show Gist options
  • Save edjdavid/05caa102318bcd3823b89c17b155d8d7 to your computer and use it in GitHub Desktop.
Save edjdavid/05caa102318bcd3823b89c17b155d8d7 to your computer and use it in GitHub Desktop.

Revisions

  1. edjdavid revised this gist Aug 7, 2023. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions wsl-docker.md
    Original file line number Diff line number Diff line change
    @@ -51,3 +51,7 @@ Modify `~/.wslconfig`, add:
    memory=4GB
    ```
    Change `memory` to reserve around 2-4GB exclusively for Windows (e.g. for 16GB RAM, 12-14GB will be a good setting)

    3. Error `err: exec: "docker-credential-pass": executable file not found in $PATH`

    Docker Desktop has created a docker config with `credstore` set to the windows binary. Edit `~/.docker/config.json` and remove the `credstore` or install one from https://github.com/docker/docker-credential-helpers and use the appropriate credstore name
  2. edjdavid revised this gist Aug 7, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion wsl-docker.md
    Original file line number Diff line number Diff line change
    @@ -25,7 +25,7 @@ wsl --shutdown

    4. In Ubuntu:

    [Install Docker Engine](https://docs.docker.com/engine/install/ubuntu/)
    [Install Docker Engine](https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository)

    ### Notes:
    1. If the internal docker network conflicts with other networks like VPN, modify or create `/etc/docker/daemon.json` and set the Bridge IP (BIP) and address pools to any available address
  3. edjdavid created this gist Aug 7, 2023.
    53 changes: 53 additions & 0 deletions wsl-docker.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,53 @@
    1. In Windows:

    Make sure WSL version is >= 0.67.6
    ```shell
    wsl --version
    ```

    \* Uninstall Docker Desktop if installed previously.

    2. In Ubuntu (or any WSL Distro):

    Modify `/etc/wsl.conf` and add
    ```conf
    [boot]
    systemd=true
    ```

    3. In Windows:

    Restart WSL
    ```shell
    wsl --shutdown
    ```
    \* WSL will restart when opening a new WSL shell

    4. In Ubuntu:

    [Install Docker Engine](https://docs.docker.com/engine/install/ubuntu/)

    ### Notes:
    1. If the internal docker network conflicts with other networks like VPN, modify or create `/etc/docker/daemon.json` and set the Bridge IP (BIP) and address pools to any available address
    ```json
    {
    "bip": "192.168.2.1/24",
    "default-address-pools": [
    {
    "base": "192.168.4.0/22",
    "size": 24
    }
    ]
    }
    ```

    2. To avoid the Windows services from hanging/stalling, limit the maximum RAM that can be used by WSL

    In Windows:

    Modify `~/.wslconfig`, add:
    ```
    [wsl2]
    memory=4GB
    ```
    Change `memory` to reserve around 2-4GB exclusively for Windows (e.g. for 16GB RAM, 12-14GB will be a good setting)