I haven't developed it recently. Somehow I bought a Windows PC. Windows 10 Home That's it. In other words, it was inevitable to prepare the Home development environment.
Until a few years ago, I was developing the following using a Mac. ・ Web application (front server side) ・ AWS infrastructure construction (defined in code)
Attempting to build the above development on Windows was difficult (in my memory), stumbling from the introduction of Ruby, Even if I was running Rails, it was unusually slow and unusable, so it was stressful.
So, the Mac level in the title means building an environment where I can develop web applications locally and on AWS without stress.
After a quick preliminary survey, I wondered if it would be good if a development environment based on Docker could be built. But remembering that Windows needed Hyper-V to run the virtual environment, it's no longer possible for me as Windows 10 Home ... When I was about to give up, I heard the voice of heaven saying "WSL2". The realization policy has been decided. WSL2 → Doker → VS Code. There is no other way.
The Windows 2020 versions that can be installed with WSL2 are as of September 2020. -"Windows 10 1903" and "Windows 10 1909" (available from August 20, 2020) ・ "Windows 10 2004"
My version of Windows was 1909, so it can be installed, but since it's a big deal, after updating to 2004 Introduce.
To check the current version, execute the following command with Win key + R. It was 1909.
winver
The rest is Windows Update. In my case, the screen looks like the one below, so press "Download and install" and just wait.
While waiting, check the WSL2 installation procedure. It has become a standard function of the OS since "Windows 10 2004", but it has only become a standard function and cannot be used unless the function is enabled. Activate. There is a straightforward feature called "Turn Windows features on or off". Execute the following command with Win key + R
OptionalFeatures
Check "Windows Subsystem for Linux" and "Virtual Machine Platform" and install.
WSL2 is now installed.
Install Docker Desktop from the following URL https://hub.docker.com/editions/community/docker-ce-desktop-windows
Make sure that WSL2 support is enabled as follows:
When the installation is completed, you will be instructed as follows, "Please install the WSL2 Linux kernel because the update is managed by another installer".
Looking at the dashboard of Docker Desktop ...
It seems that Docker based on WSL2D works with this. To check the operation, execute the following command on PowerShell according to the dashboard.
docker run -d -p 80:80 docker/getting-started
Let's take a look at the dashboard.
It seems that the server is listening on port 80, so try accessing http: // localhost / tutorial /.
The container is working. You should now be able to develop with docker on Windows 10 Home. Continue to Part 2.
Recommended Posts