-
Notifications
You must be signed in to change notification settings - Fork 16
Docker and WSL2 Set Up
Windows Subsystem for Linux version 2, is a Linux system or virtual machine running on Windows. It is recommended to use this subsystem in conjunction with Docker.
- Go to your Control Panel.
- Go to Programs -> Programs and Features.
- Then click on Enable or disable Windows features.
- Find the option and click on Windows Subsystem for Linux, Virtual Machine Platform and Windows Hypervisor Platform and then press OK.
- Now you need to restart your Windows operating system.
- Finally, go to your Microsoft Store and search for the Linux operating system of your choice, we recommend that you install Ubuntu 18.04 LTS.
Install WSL and Upgrade to WSL 2
- Open PowerShell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
- Enable Virtual Machine feature
dism.exe /online /enable-feature /feature /featurename:VirtualMachinePlatform /all /norestart
-
Install the update package from this site or Update Package. Once installed, the default WSL 2 should be updated.
-
Make the default WSL 2.
wsl --set-default-version 2
Docker Desktop is an easy-to-install application for your Mac or Windows environment that allows you to create and share containerized applications and microservices. Docker Desktop includes Docker Engine, Docker CLI client, Docker Compose, Notary, Kubernetes and Credential Helper. Docker Desktop works with your choice of development tools and languages and gives you access to an extensive library of certified images and templates in Docker Hub. This allows development teams to extend their environment to quickly build, continuously integrate and collaborate using a secure repository. Some of the key features of Docker Desktop include:
- Ability to contain and share any application on any platform in the cloud, in multiple languages and frameworks.
- Easy installation and configuration of a complete Docker development environment.
- Includes the latest version of Kubernetes.
- Automatic updates to keep you up to date and secure.
Install Docker Desktop from the Docker home page. Once installed you should open Docker Desktop, you may be prompted to restart your computer. Once in the Docker Dashboard make sure you copy the command that appears. It should be the same or similar to this command.
docker run -d -p 80:80 docker/getting-started
- Before running this command in the terminal** you must make sure which WSL distribution you are on. This can be observed in the PowerShell by the command:
wsl -l
wsl -l -v
- You will be able to notice the status of the distribution and the version. If somehow the distribution you are using is on version 1 you should change it. More Information](https://docs.docker.com/docker-for-windows/wsl/)
wsl.exe --set-version (distribution_name) 2
- Command to set future installations to distribution 2:
wsl.exe --set-default-version 2
- Now you can run your getting-started Docker.