[Details]. Docker + WSL2 defaults to only use 8GB system RAM. Bump it up to max.
C:\Users\yourUserName\.wslconfig
[wsl2]
#kernel=C:\\temp\\myCustomKernel
memory=4GB # Limits VM memory in WSL 2 to 4 GB
#processors=2 # Makes the WSL 2 VM use two virtual processors
wsl --shutdown
in Powershell).profile
, but many installs default to .bashrc
(eg Anaconda). Load .bashrc
via .profile
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
export TERM=xterm-256color
Docker on WSL2 has a memory leak. Periodically clear the cache
echo 1 | sudo tee /proc/sys/vm/drop_caches
sh ./Anaconda-whatever.sh
conda
command not recognized after shell restart, try moving whatever it added to ~\.bashrc
to ~\.profile
pip install git+https://github.com/docker/docker-py.git
pip install git+https://github.com/yoanisgil/compose.git@device-requests --ignore-installed PyYAML
~/.profile
: export COMPOSE_API_VERSION=auto
See more tricks here (note-to-self: add the useful ones into this post).