You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Michael Riedmann edited this page Dec 14, 2022
·
5 revisions
This Page is a loose collections of tasks users found worth sharing. If you think something is missing here, just add it under a new headline.
Add a mirror-registry
Sometimes you have to use internal mirror-registries (especially since the pull-policy change on docker.io). To do this you have to change the daemon.json config-file and restart docker-in-wsl. To access the right directory just execute docker-wsl show-config and edit the daemon.json file (be careful with line-endings - use a proper code-editor like VSCode or Notepad++).
Sometimes you what to share environment-variables between windows and whatever you are running inside WSL (like docker in this case).
To share for example an IMAGE_VERSION envvar with docker-compose you can set the WSLENV variable to IMAGE_VERSION/u doing SET WSLENV=IMAGE_VERSION/u. After that, all wsl commands (in the same cmd-session) should have access to the content of IMAGE_VERSION via $IMAGE_VERSION.
To add more variables just concatenate them with : like so SET WSLENV=IMAGE_VERSION/u:DB_PASSWORD/u. The /u tells WSL to sync from Win32 to WSL not touching the content of the variable. There are other flags to handle path-conversion, multiple paths, and so on. Please read the official article linked above for more information.