Your Blog2

Blog2

Weekly Technological Excursion : Docker & WSL2

This week we were tasked with cloning a git repository, and displaying a webpage using Docker. I’ll talk about my experience with setting up Docker, and a Windows Subsystem for Linux.

Docker

Where to begin? I geuss the best place to start is with Docker and what it is. Docker is a software… Okay there’s a little more. Docker is a set of platform as a service products, PaaS, that use OS-level virtualization to deliver software in packages called containers. The containers are isolated from each other and bundle their own software libraries, and configuration files, while also communicating with one another through the proper channels. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and deploy it as one package.

Windows Subsystem for Linux

The Windows Subsystem for Linux lets users run a GNU/Linux environment – including most command-line tools, utilities, and applications – directly on Windows, unmodified, without the overhead of a traditional virtual machine or dualboot setup.

Unknown Issues with Lab1 | WSL2

Well Lab1 started off rocky. In order to download Docker, I needed the most up to date version of Windows, which is Windows 10 2004. Once the 2 hour update was complete, I was finally able to download Docker Desktop. From there I ran into another issue. To open up a Windows container in Docker, I needed Windows Enterprise or Pro. Insert Sad Face “Well you coudl’ve just ran a virtual machine with the correct requirements and done the lab through there”, and yes, I could have. But I wasn’t about to give up. After a bit of researching, and noticing that the lab is done in Ubuntu, I recalled that Windows now has the ability to run Linux distros! How dope is that! It’s like the movie Inception, but with operating systems. The Ubuntu distro is on the Microsoft Store, so a simple installation.

Wow! I could begin my lab! Ehh not really… That’s when I found out that in order for Docker to run on my Ubuntu, it must be enabled and configured.

How to Install The Windows Subsystem for Linux and Setup Docker
  • Step 1 - Enable the Windows Subsystem for Linux
    • Open PowerShell as Administrator and run: dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
  • Step 2 - Go to the Microsoft Store and download your preferred Linux Distro.
    • In the example below, I chose Ubuntu since it lines up with our Lab1
  • Step 3 - Set your distribution version to WSL 2
    • Run - wsl –set-default-version 2
  • Step 4 - From within the Docker Menu check the “Use the WSL 2 based engine”, then click “Apply & Restart”

  • Step 5 - Now open Docker up again, and go to Settings > Resources > WSL Integration. From there just enable the integration, then “Apply and restart”

  • Step 6 - Now you can begin CIT 480 Lab1!
Written on September 17, 2020