Build a Doker-based development environment on Windows 10 Home 2020 ver. Part 1 Until WSL2-based Docker build

Introduction

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.

What kind of development do you want to do?

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.

How to achieve

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.

Introducing WSL2 to Windows 10 Home

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.

Introduced Windows 10 2004

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. image.png

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. image.png

WSL2 is now installed.

Install Docker Desktop

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: image.png

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". image.png

Looking at the dashboard of Docker Desktop ... image.png

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. image.png

It seems that the server is listening on port 80, so try accessing http: // localhost / tutorial /.

image.png

The container is working. You should now be able to develop with docker on Windows 10 Home. Continue to Part 2.

Recommended Posts

Build a Doker-based development environment on Windows 10 Home 2020 ver. Part 1 Until WSL2-based Docker build
Build a Docker-based development environment on Windows 10 Home 2020 ver. Part 2 VS Code should make the Docker development environment comfortable
Build Unity development environment on docker
Install Ubuntu 20.04 in virtual box on windows10 and build a development environment using docker
A memo when building a Rails 5.2 development environment using Docker Desktop + WSL2 on Windows 10 Home
Build a PureScript development environment with Docker
Build a development environment where Ruby on Rails breakpoints work on Windows
Build a Java development environment on Mac
Building a haskell environment with Docker + VS Code on Windows 10 Home
Build a Wordpress development environment with Docker
Build an Ultra96v2 development environment on Docker 1
Build a simple Docker + Django development environment
[Copy and paste] Build a Laravel development environment with Docker Compose Part 2
How to build a Ruby on Rails development environment with Docker (Rails 6.x)
How to build a Ruby on Rails development environment with Docker (Rails 5.x)
Build a development environment for Docker + Rails6 + Postgresql
Build a WordPress development environment quickly with Docker
Build a simple Docker Compose + Django development environment
Build a development environment for Docker, java, vscode
Build a development environment to create Ruby on Jets + React apps with Docker
Build a Ruby on Rails development environment on AWS Cloud9
Try to build a Java development environment using Docker
Until you build a Nuxt.js development environment with Docker and touch it with VS Code
Try Docker on Windows 10 Home
Ruby ① Build a Windows environment
Build a Node.js environment with Docker
Use Docker Compose on Windows 10 Home
Build a XAMPP environment on Ubuntu
Try Docker on Windows Home (September 2020)
Using Docker on Windows10 Home WSL2
Until you put Ubuntu 20 on Windows 10 Home and WSL2 and run Docker
Build an ASP.net Core Web API environment on Docker (VSCode) Part 1
Build a browser test environment using Capybara in the Docker development environment
Build an ASP.NET Core Web API environment on Docker (VSCode) Part 2
Build a development environment for Django + MySQL + nginx with Docker Compose
Steps to build a Ruby on Rails development environment with Vagrant
Build debug environment on container --Build local development environment for Rails tutorial with Docker-
Let's install Docker on Windows 10 and create a verification environment for CentOS 8!
How to build a Ruby on Rails environment using Docker (for Docker beginners)
Creating a java web application development environment with docker for mac part1
Build a WAS execution environment from Docker
Build a web application development environment that uses Java, MySQL, and Redis with Docker CE for Windows
I tried to build a Firebase application development environment with Docker in 2020
[Ruby] Building a Ruby development environment on Ubuntu
Build Java 8 development environment on AWS Cloud9
Build a local development environment for Rails tutorials with Docker (Rails 6 + PostgreSQL + Webpack)
[Copy and paste] Build a Laravel development environment with Docker Compose Participation
Build Redmine code reading environment on Docker
Build a development environment on AWS EC2 with CentOS7 + Nginx + pm2 + Nuxt.js
Build an environment with Docker on AWS
Template: Build a Ruby / Rails development environment with a Docker container (Ubuntu version)
Build a JMeter environment on your Mac
Create a java web application development environment with docker for mac part2
Template: Build a Ruby / Rails development environment with a Docker container (Mac version)
[First environment construction] I tried to create a Rails 6 + MySQL 8.0 + Docker environment on Windows 10.
Build a Laravel / Docker environment with VSCode devcontainer
[Java] Build Java development environment on Ubuntu & check execution
Build Apache / Tomcat development environment on Cent OS 7
Building OpenPose (Pytorch_Realtime_Multi-Person_Pose_Estimation) environment on Docker: training part
Build a Laravel environment on an AWS instance
[Win10] Build a JSF development environment with NetBeans