apps:docker:dockerdesktopforwindows
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
apps:docker:dockerdesktopforwindows [2024-06-05 16:16] – 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 | %UserProfile%\.wslconfig | ||
+ | </ | ||
+ | <code ini> | ||
[experimental] | [experimental] | ||
autoMemoryReclaim=gradual | autoMemoryReclaim=gradual | ||
Line 58: | Line 82: | ||
</ | </ | ||
- | ===== Shring VHDX ===== | + | ===== WSL2 Backend |
- | < | + | WSL2 is the recommended backend |
- | PS C:\> Get-Item | + | * " |
+ | * " | ||
- | Directory: C: | + | ==== List Distributions ==== |
+ | < | ||
+ | wsl -l -v | ||
+ | </ | ||
- | Mode | + | <code - Example> |
- | ---- ------------- ------ ---- | + | PS C:\> wsl -l -v |
- | -a---- | + | NAME |
+ | * docker-desktop-data Running | ||
+ | docker-desktop | ||
+ | </code> | ||
+ | < | ||
+ | wsl -d docker-desktop | ||
+ | </ | ||
- | https:// | + | < |
+ | PS C:\> wsl -l -v | ||
+ | NAME | ||
+ | * docker-desktop-data Running | ||
+ | docker-desktop | ||
- | PS C: | + | PS C: |
- | PS C:\> Optimize-VHD -Path c: | + | DESKTOP-4D1F8L4:/# |
+ | </code> | ||
+ | ==== Shrink VHDX ==== | ||
- | PS C:\> wsl --shutdown | + | The virtual disks (VHDX) for the WSL2 VMs will grow to contain all the container data. If they get too big you have to do an offline shrink operation to get them back to a smaller size. |
- | PS C:\> Optimize-VHD C: | + | Make sure, the Docker |
+ | Shutdown the WSL2 distributions. | ||
+ | < | ||
+ | wsl --shutdown | ||
+ | </ | ||
- | PS C:\> Get-Item C: | + | Shrink both disks with " |
+ | <code> | ||
+ | Optimize-VHD -Path "C: | ||
+ | Optimize-VHD -Path " | ||
+ | </ | ||
+ | If Optimize-VHD is done, just start Docker Desktop for Windows again. | ||
+ | |||
+ | Example. | ||
+ | < | ||
+ | PS C:\> Get-Item C: | ||
Directory: 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.1717596995.txt.gz · Last modified: 2024-06-05 16:16 by Manuel Frei