apps:docker:dockerdesktopforwindows
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
apps:docker:dockerdesktopforwindows [2024-06-05 16:14] – created Manuel Frei | apps:docker:dockerdesktopforwindows [2024-06-13 02:48] (current) – Manuel Frei | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Docker Desktop for Windows ====== | ====== Docker Desktop for Windows ====== | ||
- | FIXME FIXME FIXME | + | ===== Purpose / Usage ===== |
- | ===== Config ===== | + | Docker Desktop is a UI to help developers working with the Docker engine. <color # |
- | < | + | * It only works within an interactive user session |
+ | * There are memory usage problems: [[https:// | ||
- | %UserProfile%\.docker\daemon.json | ||
+ | ===== Configuration ===== | ||
+ | |||
+ | ==== Docker Daemon ==== | ||
+ | |||
+ | < | ||
+ | %UserProfile%\.docker\daemon.json | ||
+ | </ | ||
- | # before: | + | Default configuration as of Docker Desktop for Windows version 4.30.0 (2024-06-06). |
+ | <code JavaScript daemon.json> | ||
{ | { | ||
" | " | ||
Line 20: | Line 28: | ||
" | " | ||
} | } | ||
+ | </ | ||
- | # after: | + | The default log driver is json-file. All the lines that are written to the stdout/ |
+ | |||
+ | <code JavaScript daemon.json> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | Together with the default configuration, | ||
+ | <code JavaScript daemon.json> | ||
{ | { | ||
" | " | ||
Line 37: | Line 58: | ||
} | } | ||
} | } | ||
+ | </ | ||
+ | ==== WSL2 ==== | ||
+ | |||
+ | < | ||
+ | %UserProfile%\.wslconfig | ||
</ | </ | ||
+ | <code ini> | ||
+ | [experimental] | ||
+ | autoMemoryReclaim=gradual | ||
- | ===== Shring VHDX ===== | ||
- | < | + | [wsl2] |
+ | memory=24GB | ||
+ | networkingMode=mirrored | ||
+ | dnsTunneling=true | ||
+ | firewall=true | ||
+ | autoProxy=true | ||
+ | [experimental] | ||
+ | autoMemoryReclaim=gradual | ||
- | PS C:\> Get-Item C: | + | </code> |
+ | ===== WSL2 Backend ===== | ||
- | Directory: C: | + | WSL2 is the recommended backend |
+ | * " | ||
+ | * " | ||
- | Mode | ||
- | ---- | ||
- | -a---- | ||
+ | ==== List Distributions ==== | ||
- | https:// | + | < |
+ | wsl -l -v | ||
+ | </code> | ||
- | PS C: | + | <code - Example> |
- | PS C:\> Optimize-VHD -Path c: | + | PS C: |
+ | NAME | ||
+ | * docker-desktop-data Running | ||
+ | docker-desktop | ||
+ | </ | ||
+ | < | ||
+ | wsl -d docker-desktop | ||
+ | </ | ||
- | PS C:\> wsl --shutdown | + | < |
+ | PS C:\> wsl -l -v | ||
+ | NAME | ||
+ | * docker-desktop-data | ||
+ | docker-desktop | ||
- | PS C: | + | PS C:\> wsl -d docker-desktop |
+ | DESKTOP-4D1F8L4:/# | ||
+ | </ | ||
+ | ==== Shrink VHDX ==== | ||
- | PS C:\> Get-Item C: | + | The virtual disks (VHDX) for the WSL2 VMs will grow to contain all the container |
+ | Make sure, the Docker Engine is stopped and close Docker Desktop for Windows. | ||
- | Directory: C: | + | Shutdown the WSL2 distributions. |
+ | < | ||
+ | wsl --shutdown | ||
+ | </ | ||
+ | Shrink both disks with " | ||
+ | < | ||
+ | Optimize-VHD -Path " | ||
+ | Optimize-VHD -Path " | ||
+ | </ | ||
+ | |||
+ | If Optimize-VHD is done, just start Docker Desktop for Windows again. | ||
+ | |||
+ | Example. | ||
+ | < | ||
+ | PS C:\> Get-Item C: | ||
+ | |||
+ | Directory: C: | ||
Mode | Mode | ||
---- | ---- | ||
- | -a---- | + | -a---- |
+ | PS C:\> wsl --shutdown | ||
+ | PS C:\> Optimize-VHD C: | ||
+ | PS C:\> Get-Item C: | ||
+ | Directory: C: | ||
- | PS C:\> wsl -l -v | + | Mode |
- | NAME | + | ---- |
- | * docker-desktop-data Running | + | -a---- 04/ |
- | | + | </ |
- | PS C:\> wsl -d docker-desktop | + | ===== Links ===== |
- | DESKTOP-4D1F8L4:/# | + | |
+ | * [[https:// | ||
- | |||
- | </ | ||
apps/docker/dockerdesktopforwindows.1717596894.txt.gz · Last modified: 2024-06-05 16:14 by Manuel Frei