

Use CTRL + X and CTRL + Y to exit the editor and save the file.Ĥ. # copy all the project files to the container FROM python:3 # the base image WORKDIR //myproject # set the project directory COPY. There are many ways to create a Dockerfile to specify your needs, but we will create a simple one. The nano text editor will open the Dockerfile you just created.

To install nano run the following commands. Now create a Dockerfile using the nano text editor. First create a directory called ‘myproject’ where our project repository will be stored, and navigate into it.Ģ.It is a simple text file that contains a list of commands needed to assemble the image. Although we can build our image manually the most efficient method is to use a Dockerfile as it automates the process. First we need to create an image (a template used to build our container). Now that we have docker installed, let’s create a container. After your Linux distribution is installed, check its WSL version by running the following command. In this tutorial we are using Ubuntu 18.04 LTS.ħ. Install a Linux distribution from the Microsoft Store. Download the WSL2 Linux kernel update package and run it.ĥ. dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestartĤ. Next, enable the Virtual Machine Platform feature. Open a Powershell terminal as Administratorĭism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestartĢ.More detailed installation instructions can be found through Microsoft’s documentation, but the following summarizes the steps. As the name implies, WSL2 is an upgraded version of WSL aiming to increase file system performance and add full system call functionality. Both options require allocation of resources -such as CPU and storage - but WSL removes this overhead. Traditionally to gain access to a Linux machine Windows users would have to install a virtual machine such as VirtualBox or do a dual-boot setup. WSL stands for Windows Subsystem for Linux. To gain access to a Linux machine we will be using WSL2 - but what is WSL2 and why are we using it? If you need to run Docker for Linux but do not want to use a virtual machine (VM) or do dual-booting, this set-up is ideal for you. If you are a Windows user, this tutorial will help you set up a docker container in a Linux environment and connect to it through a local installation of Visual Studio Code.
